entity framework - How to couple 2 objects using the highest row version of one of the objects -


i having @ entity framework , wondering how join 2 objects 1 object contains row version column.

for example

public class product {     [key, column(order = 1)]      public guid productguid {get;set;}     [key, column(order = 2)]      public int rowversion {get;set;}      public string displayname {get;set;}     // ... more properties ... }  public class deviceconfiguration {     [key]     public product theproduct {get;set;}     [key]     public string workstationname {get;set;}      public string configurationstring {get;set;} } 

how can deviceconfiguration pick product row highest value of rowversion?

from described, have database , develop application using database. here's excellent resource working ef covers scenario facing:

creating entity framework data model asp.net mvc application (1 of 10)

take @ entity framework development approaches sub-chapter, you'll interested know more details the:

database first

if have database, entity framework can automatically generate data model consists of classes , properties correspond existing database objects such tables , columns. information database structure (store schema), data model (conceptual model), , mapping between them stored in xml in .edmx file. visual studio provides entity framework designer, graphical designer can use display , edit .edmx file. sections getting started entity framework , continuing entity framework in web forms tutorial series use database first development.


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -