I'm having one entity type throw an exception when trying to delete it with this code:
private List<string> Delete(List<string> entitiesToDelete)
{
List<string> deletedEntities = new List<string>();
using (DataAccessAdapter adapter = new DataAccessAdapter())
{
foreach (string entity in entitiesToDelete)
{
try
{
adapter.DeleteEntitiesDirectly(entity, null);
deletedEntities.Add(entity);
_log.Info(entity);
}
catch (Exception ex)
{
_log.Info(entity + " ------------------ " + ex.ToString());
}
}
return deletedEntities;
}
}
The error message is this:
HelperNew - LookupIndustryScenarioEntity ------------------ System.ArgumentNullException: fieldsPersistenceInfo can't be null or empty.
Parameter name: fieldsPersistenceInfo
at SD.LLBLGen.Pro.ORMSupportClasses.DynamicQueryEngineBase.CreateDeleteDQ(IFieldPersistenceInfo[] fieldsPersistenceInfo, IDbConnection connectionToUse, List1 pkFilters, IPredicate additionalDeleteFilter, IRelationCollection relationsToWalk)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.CreateDeleteDQ(IFieldPersistenceInfo[] fieldsPersistenceInfo, List
1 pkFilters, IPredicate additionalDeleteFilter, IRelationCollection relationsToWalk)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.DeleteEntitiesDirectly(String entityName, IRelationPredicateBucket filterBucket)
at sap.valuecollateral.tests.HelperNew.Delete(List`1 entitiesToDelete) in G:\My Documents\code\Work\sap\valuecollateral\website2005\trunk\tests\sap.valuecollateral.tests\HelperNew.cs:line 95
Using Adapter, llbl 2.0
The item dying on deletion is part of a TargetPerEntityHierarchy using an integer discriminator column. It is 2 levels, w/ the parent being LookupIndustry, and the 2 children being LookupIndustrySubSegment, and LookupIndustryScenario. It is only LookupIndustryScenario that is having difficulty w/ deletion, but there isn't much of a difference between the 2 classes. (Only 1 bit field that isn't part of any relations)
Any thoughts as to what this error means?