Using Entity Framework entities as business objects?

前端 未结 7 1730
借酒劲吻你
借酒劲吻你 2020-11-30 20:34

I\'m using Entity Framework O/R mapper from Microsoft and using entity classes (generated classes that are mapped to DB objects) as a business objects. Is this OK? Please s

相关标签:
7条回答
  • 2020-11-30 21:32

    Two limitations to be aware of that I have run into are:

    1. Inherited Objects cannot have Navigation Properties - i.e. if you have a "person" class and then a "customer" and "supplier" those customer and suppliers cannont have Navigation properties.

    2. Methods and Calculated Fields (anything in the partial classes) are not transmitted over ADO.Net Data Services - if you are also using ADO.Net Data Services anything you expand the Entity Framework objects on in partial classes will not be transmitted over ADO.Net Data Services.

    These are generally not show-stopper items (for navigation properties we just don't use inheritance on entity framework, for now), but might be something of interest to yourself. I'm holding out hope that a future release will enable both of these items.

    0 讨论(0)
提交回复
热议问题