Im trying to create a WCF-service to hold generic data for a bunch of different applications. Something like this:
[ServiceContract]
public interface IDataService
{
[OperationContract]
IEnumerable<IDataObject> Retrive(string query);
}
[DataContract]
public interface IDataObject
{
}
Now what I really would want is some way of using LINQ instead of a string-query. I mean like this:
var set = ds.Retrieve().OfType<INote>().OrderBy(n =>开发者_如何学Go n.Created).Take(50);
Is this possible somehow?
It sounds like using WCF Data Services would be the way to go.
You could also define your own IQueryProvider and serialize the LINQ expression tree if you need truly complex LINQ support. See:
http://msdn.microsoft.com/en-us/library/bb546158.aspx
http://interlinq.codeplex.com/
精彩评论