开发者

ADO.NET Entity Framework and WCF in .NET 3.5 Framework

In my new project I am asked to use ADO.NET Entity framework and WCF Services. I am quite to new to this but when I studied and worked on few samples I found idea behind using Entity framework entities as WCF contract is pretty confusing. So wanted to know what is the general opinion on this. I studied about开发者_如何学JAVA Persistence Ignorance as well and bit about POCO support in 4.0 version but somehow we can't move to 4.0 for this project. IS PI possible in 3.5 as well ? Are there any samples available which I can study. I tried implementing POCO adapter but the sample available on Codeplex was too confusing to implement in a web application.

My overall point is to decouple the DataContracts and the Entities created by the Entity Framework. how is that possible or using Ado.net Entities as Contract is the only option in 3.5.


You might want to check out this EF Poco Adapter for Entity Framework v1.0. It specifically applies Persistence Ignorance for Entity Framework entities. As for using it with WCF, you may or may not be able to couple it with WCF Data Services, I haven't explored this.

Actually, you could expose the POCO entities via WCF data contracts:

"Entity Framework V1 programming interfaces are wrapped with corresponding APIs that work with POCO objects and do necessary translation between POCO and Persistence-Aware objects."

So all you need to do is wire up your data access on the service side and (apparently) the EF Adapter will handle mapping to the persistence aware versions for you.


You can use WCF Data Services in .NET 3.5.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜