Returning EF entities using WCF - Read only web service / public API

Posted by alex on Stack Overflow See other posts from Stack Overflow or by alex
Published on 2010-04-20T21:38:05Z Indexed on 2010/04/20 21:43 UTC
Read the original article Hit count: 208

Filed under:
|
|

I'm currently migrating an application from Linq-to-SQL & ASP.net Web Services (asmx) to Entity Framework and WCF.

My question is, I have a bunch of POCO classes which i have xml mapping files for (for the linq to sql) I've replaced my linq to sql with an entity framework data model

I've got an interface - something like IService - that has all the methods on it that i need my service to implement - for example:

Product[] GetProductsByKeyword(string keyword);

In the above case, Product is a POCO. I now have them as entities within my ef data model - i'm using .net 4, and could take advantage of poco support, but don't really see the need - This service is strictly read only.

What's the best way of returning entities in my WCF service? I want it to support other client platforms, not just .net (so php guys could use it)

© Stack Overflow or respective owner

Related posts about wcf

Related posts about entity-framework