Can I abstract Entity Framework away from my Entities?

前端 未结 5 1282
野性不改
野性不改 2021-02-08 16:03

I have a Foo entity in Entity Framework. But I\'m making it inherit from IFoo so that my business logic only knows IFoo - thus abstracting

5条回答
  •  南方客
    南方客 (楼主)
    2021-02-08 16:17

    I recently wrote a comprehensive post about this: Persistence Ignorance in ADO.NET Entity Framework. You might want to look at EFPocoAdapter. That does just this and it will eventually deprecate into EF v2.

    For what it's worth, I am using EFPocoAdapater and it's been working well for me.

提交回复
热议问题