protected internal static int DeleteAll(Type targetType, IEnumerable pkValues)
{
if (pkValues == null)
{
return 0;
}
int counter = 0;
foreach (object pk in pkValues)
{
Object obj = FindByPrimaryKey(targetType, pk, false);
if (obj != null)
{
ActiveRecordBase arBase = obj as ActiveRecordBase;
if (arBase != null)
{
arBase.Delete(); // in order to allow override of the virtual "Delete()" method
}
else
{
Delete(obj);
}
counter++;
}
}
return counter;
}