开发者

WCF. to send data through service and client

I have a service. This service g开发者_高级运维et data from SQL Server.

  1. What the best way to send information to client?
  2. Should I use ADO.NET or Entity Framework?


You can use whichever data technology you want. However, up to Entity Framework 4 in .NET 4 (currently in Release Candidate status), it is recommended not to return an Entity Framework entity or a LINQ to SQL class from a web service. Both technologies unfortunately leak their implementation over the wire - the client-side proxy classes would have client-side classes corresponding to the base classes used by the data framework.

Instead, use a Data Transfer Object, which is an object that has nothing but properties that correspond one-to-one with the properties of the data you want transferred.


From such a brief description it is impossible to say which one is preferred. My personal favourite for such a scenario is Linq to SQL.


If they are both .NET then i say WCF. If server does simple manipulations with data consider Linq to SQL. Or nHibernate.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜