开发者

Entity Framework 4.0 and Stored Procedures

开发者 https://www.devze.com 2023-01-05 02:30 出处:网络
Are there any examples/articles on how to use the Entity Framework 4.0 Code First model (no edmx or xml configuration anywhere!!!开发者_如何学运维) that interacts with stored procedures? Another aspec

Are there any examples/articles on how to use the Entity Framework 4.0 Code First model (no edmx or xml configuration anywhere!!!开发者_如何学运维) that interacts with stored procedures? Another aspect to my requirements is I am using a Repository pattern that uses an IRepository interface to abstract the actual data store (memory, database, xml, etc). Thus, I suppose it would be a hack to expose the ObjectContext so that I can call ExecuteFunction(...) on the ObjectContext instance since the caller of IRepository can never assume it is hitting a database. I was hoping to specify all stored procedure mapping logic in my mapping class for the entity. The mapping class is a subclass of EntityConfiguration. Is the 4.0 CTP mature enough for this yet?


I know it's a bit late now, but here is something worthwhile looking into: Entity Framework CTP5 - How to Call Stored Procedure? and Using stored procedures with Entity Framework 4 Code First CTP5. Did you manage with this?

0

精彩评论

暂无评论...
验证码 换一张
取 消