sgtz
sgtz

Reputation: 9019

LINQ serialization

Somewhere (I wish I knew where), Jon Skeet and Marc Gravel were thinking about working on a tool that translated a LINQ query to XML for transfer over the wire? Does anyone know if they, or someone else has done this and made it public?

Scenario: distributed & cross assembly. This is a nice to have feature for me at this stage.

Maybe this isn't possible yet.

Upvotes: 7

Views: 347

Answers (1)

Kirill Polishchuk
Kirill Polishchuk

Reputation: 56222

You can take a look to WCF Data Services.

The WCF Data Services client library enables you to execute queries against a data service by using familiar .NET Framework programming patterns, including using language integrated query (LINQ).

It can translate LINQ queries, e.g.:

var selectedOrders = from o in context.Orders
    where o.Freight > 30
    orderby o.ShippedDate descending 
    select o;

will translated into following URI: http://localhost:12345/Northwind.svc/Orders?Orderby=ShippedDate&?filter=Freight gt 30

Upvotes: 7

Related Questions