Returning EF entities using WCF - Read only web service / public API
- by alex
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)