开发者

Are EntityFramework generated Entity Persistence Ignorance

开发者 https://www.devze.com 2022-12-27 07:58 出处:网络
So I\'m starting to look into EF and POCO. 开发者_如何学C From my understanding, the entity generated by EF is not pure POCO since it inherit from EntityObject.

So I'm starting to look into EF and POCO.

开发者_如何学C

From my understanding, the entity generated by EF is not pure POCO since it inherit from EntityObject.

But are they PI? It seem to me that they don't have any persistence awareness in them, or there is something in the EntityObject that makes them PI?


With C# 4.0 / .NET 4, the Entity Framework supports POCO's as entities and thus supports what is called Persistence Ignorance. In previous releases, this was not supported.

On the Switzerland Techdays site, you will find 2 Sessions on Entity Framework 4.0 with Jeff Derstadt, with video and slides coverage, in english:

  • Introducing the Entity Framework 4.0
  • Entity Framework 4.0 Deep Dive: Patterns and Architecture


Entity Framework is persistence independent in that it is possible to write custom Entity Framework providers for alternate data stores. For example, here is a sample provider written for Oracle.

http://code.msdn.microsoft.com/EFOracleProvider

As for the POCO support, I believe the picture is much improved in Framework 4.0 where POCO's are supported. I might have this wrong though, since I am a little new to this my self.

0

精彩评论

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

关注公众号