views:

40

answers:

0

I have an ADO.NET data service based off of a LINQ-To-SQL class. I can query this ADO.NET service using LINQ to Rest queries which build simple rest statements. But if I want to use other functions that work in LINQ-To-SQL I get an error that the LINQ-To-Rest statement can't be made into a rest query.

Example:

X.Data.Cust.CustData db = new X.Data.Cust.CustData(new Uri(AppSettings.CustServiceURL));


        var custInfo = (from a in db.AdditionalCustomerInformations
                        where a.CustomerInformation.STATE == "NJ" && a.ElecMeters.First().MtrStatus == "A"
                        select a).Take(5) as DataServiceQuery<X.Data.Cust.AdditionalCustomerInformation>;
        custInfo.BeginExecute(CallbackForQuery, custInfo);

I get an error saying that the First() function doesn't exist. If I wanted to use Count() instead of First I'd get an error as well saying the Count() function doesn't exist.

My question is how would I add the First() or Count() functions in this case to the data service?

I also don't care about standards compliance. I'm in control of both ends of the communication and I'm the only one consuming this service.

Thanks