entity framework - Include Foreign Key Properties in DataObjects.Net -


i'm concerned in problems have entity framework , may need find replacement. according ormbattle, best candidate dataobjects.net, result of initial investigations promising, except 1 feature need in our structure:

consider 2 classes: order , customer, in class "order" have "customer" navigation property (and "orders" navigation property in customer class). need property customerid in class order. totally possible in lowly ef4.

how can achieve goal?

you can add non-persistent property special getter job:

public long customerid { { return getreferencekey(typeinfo.fields["customer"]).value.getvalue<long>(0); } } 

the setter can added in same manner.

hope helps.

p.s.
copy of original answer can found on official dataobjects.net support site.


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -