Deleteing from IQueryable<T>

Posts   
 
    
rboarman
User
Posts: 83
Joined: 01-Feb-2005
# Posted on: 03-Sep-2010 22:39:36   

Given an IQueryable<T>, how can I delete the data without fetching the records via ToList()?

For example:

var requests = from r in Repository.For<RequestEntity>()
                               where r.ClientId == clientId
                               select r;

dbAdapter.Delete (requests); <== or something like this

Thanks,

Rick

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 03-Sep-2010 23:32:27   

No possible, at least not built in (I suppose you can write code to translate a linq expression to a predicateexpression) . LINQ2LLBL is just for fetching. So if you don't want to fetch, you need to write the predicate with LLBLGen api classes (PredicateExpression) and use the adapter.DeleteMulti method.

David Elizondo | LLBLGen Support Team