Hi there, I'm not sure if it is possible. But I want to remove some entities at the same time. I have a function:
private static void RemoveAllDiscipline(int workGoalId, IList<int> disciplineIDs)
{
//remove all discipline
using (DataAccessAdapter adapter = new DataAccessAdapter())
{
IRelationPredicateBucket filter = new RelationPredicateBucket();
filter.PredicateExpression.Add(IbpWorkPlanFields.IbpworkGoalId == workGoalId);
filter.PredicateExpression.Add(IbpWorkPlanFields.IbpdisciplineId == disciplineIDs);
adapter.DeleteEntitiesDirectly("IbpWorkPlanEntity", filter);
}
}
As you can see disciplineIDs is a generic list. But I'm not sure if I can use it in this way. In the documentation it is said that if you want to use a where in (x,y,z) clause you could do it like this, but when I use it like this an exception is thrown.
SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException was unhandled by user code
Message="An exception was caught during the execution of an action query: Failed to convert parameter value from a List`1 to a Int32..
If this is not the way, what is? Do I have to iterate through the collection and delete the entity one at a time?
Thx