github twitter linkedin email
Why I prefer LLBLGenPro over Entity Framework (EF4)
Feb 1, 2011
One minute read

LLBLGenPro allows bulk operations.

Here are the pertinent Stack Overflow questions regarding this:

The answer is no, unless you write your own stored procedures / tsql code.

(Note: Code snippets taken from LLBLGen Documentation)

Enter LLBLGenPro, I can update the CHOPS entitiy directly, without even fetching it:

var customer = new CustomerEntity();
customer.CustomerID="CHOPS";
customer.IsNew=false;
customer.Phone = "(605)555-4321";
DataAccessAdapter adapter = new DataAccessAdapter();
adapter.SaveEntity(customer);

Or, I can update all entities that match a predicate:

RelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(ProductFields.CategoryId == 3);
ProductEntity updateValuesProduct = new ProductEntity();
updateValuesProduct.Discontinued=true;
DataAccessAdapter adapter = new DataAccessAdapter();
int amountUpdated = adapter.UpdateEntitiesDirectly(updateValuesProduct, bucket);

No, you may not be familiar with the Query API of LLBLGen, but the important thing to know is that LLBLGen supports this, while EF requires a dba to write TSQL that is specific for a particular database (sql express, mysql, etc)

Check out the LLBLGen documentation here.

As an aside, LLBLGen supports all of the scenarios that EF4 does, including a LINQ provider.  It’s just that LLBLGen give developers more power.


Tags: LLBLGen

Back to posts