Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> DeleteEntitiesDirectly and UpdateEntitiesDirectly with LINQ expressions
 

Pages: 1
LLBLGen Pro Runtime Framework
DeleteEntitiesDirectly and UpdateEntitiesDirectly with LINQ expressions
Page:1/1 

  Print all messages in this thread  
Poster Message
ioan
User



Location:

Joined on:
20-Nov-2018 16:13:40
Posted:
12 posts
# Posted on: 26-Feb-2019 10:35:39.  
I tried to find an easy way of deleting/updating entities directly in LLBLGen, and the methods DeleteEntitiesDirectly/UpdateEntitiesDirectly seem the perfect match for what I need. However, it would be way easier to use something like:

Code:

adapter.DeleteEntitiesDirectly<Customer>(c => c.Name.StartsWith("John"));


instead of manually creating the predicate bucket. Did I miss something or these LINQ expressions are not supported currently?
  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14464 posts
# Posted on: 27-Feb-2019 06:29:55.  
This is not available.
I'll pass your request to the developing team.


  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37375 posts
# Posted on: 27-Feb-2019 10:36:31.  
Parsing expression trees is pretty complicated, as there's no end to what you can add there: you can specify a complicated expression there spanning a lot of entities. Parsing expression trees in our linq provider is a complicated process which isn't re-usable here, hence we don't offer that.

It's not all bad tho. The QuerySpec extension methods make specifying the predicates not that complicated.

Code:
adapter.DeleteEntitiesDirectly(new RelationPredicateBucket(CustomerFields.Name.Equal("John")));


If you hate the bucket ctor call, you can add an extension method, e.g. ToBucket(IPredicate) :

Code:
public static IRelationPredicateBucket(this IPredicate toWrap)
{
    return new RelationPredicateBucket(toWrap);
}


Which then leads to:

Code:
adapter.DeleteEntitiesDirectly(CustomerFields.Name.Equal("John").ToBucket());

Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
ioan
User



Location:

Joined on:
20-Nov-2018 16:13:40
Posted:
12 posts
# Posted on: 27-Feb-2019 16:21:56.  
@Otis: thanks for the clarification. It would have been very nice to have a syntax not so dependent on LLBLGen, like LINQ is, but I understand the difficulties. At least I know what I can do Regular Smiley.

  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.