Hi,
I use LLBLGen pro 3.1 And DataAccessAdapter via VS2008.
I would like to delete some entities by an Expression. I have an Expression<Func<TEntity, bool> for filtering entities. I found DeleteEntitiesDirectly Method from DataAccesAdapter to delete by a predicate. DeleteEntitiesDirectly Method get 2 parameters Type and RelationPredicateBucket. And we can add predicate to RelationPredicateBucket.
So i convert Expression to a predicate by this code:
Expression<Func<TEntity, bool>> filter;
Func<TEntity, bool> func = filter.Compile();
System.Predicate<TEntity> predicate = func.Invoke;
var bucket = new RelationPredicateBucket();
var type = typeof(TEntity);
I try to do this:
bucket.PredicateExpression.Add(predicate);
dataAccessAdapter.DeleteEntitiesDirectly(type, bucket);
But we can't add a System.Predicate to bucket.PredicateExpression.
What am I doing wrong? How can i do this?
Thanks in Advance
Rahman