LINQ Over WCF

Posts   
 
    
nortonmi
User
Posts: 1
Joined: 01-Nov-2010
# Posted on: 01-Nov-2010 09:40:12   

I have been looking at LLBLGen for a couple of days now and I was wondering if anyone is using it to create LINQ queries on the client and then have them performed remotely on the server using WCF?

I would like to do the following:

var oldCustomers = Data.Customers.Where(c => c.EstablishedDate.Year == 2005);

Somehow the "system" would need to know to perform the query on the server.

Any ideas/thoughts?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 02-Nov-2010 06:41:18   

You could use PredicateBuilder to generate a IQueryable to send to your WCF method. I never tried that but I think it should work:

var predicate = PredicateBuilder.Null<CustomerEntity>();
predicate = predicate.Or(c => c.EstablishedDate.Year == 2005);

var oldCustomers = Data.Customers.FetchFromCustomPredicate(predicate);
David Elizondo | LLBLGen Support Team