Code First Join options in Entity Framework 5 -
i'm creating webservice layer on legacy sql server based system. it's pretty large , complicated business application has large number of stored procedures perform select statements . of these stored procedures join number of tables , produce single resultset easy consumption client.
in building webservice want take advantage of ef, , using code first approach 80% of use cases can achieved mapping direclty tables. have number of use cases need cross tbale views of data provided stored procedures. see have 3 options:
- create new pocos represent stored procedure returns , link these existing stored procedures (let sql join , re-use exisitng code)
- create new pocos stored procedure return, populate association othe ef entities (let ef jons)
- do joins somehow in linq
what people think best practice in situations this, guess of coming against everyday?
thanks, andy
many book out there. julie lerman... more recent http://www.apress.com/9781430257882
with navigation properties, can things without old fashioned joins.
so 4) in linq,and let ef joins. use navigation properties. can many logical joins , avoid join keyword.
this blog shows how easy , why linq no join syntax results in joins @ db level. http://blog.staticvoid.co.nz/2012/7/17/entity_framework-navigation_property_basics_with_code_first
Comments
Post a Comment