All,
I'm working on a project where the architectural requirement is to set an "isDeleted" flag on the table rather than actually delete the record. The initial plan for the selfservicing project is simple: To override the "Delete(IPredicate deleteRestriction)" method on CommonEntityBase.
The code thus looks something like this.
public override bool Delete(IPredicate deleteRestriction)
{
bool success = false;
var isDeleted = this.GetFieldByName("IsDeleted");
if (isDeleted != null)
{
isDeleted.CurrentValue = true;
this.IsDirty = true;
success = Save(deleteRestriction);
}
else
{
success = base.Delete(deleteRestriction);
}
return success;
}
This works well, my question thus, is around how this would work with an update restriction set. Or when multiple items in a collection are deleted.
If an update restriction causes the item not to be changed(or deleted), does it throw an exception or return false?
Are there any other obvious flaws to this plan that anyone can see.
This is my first experience of LLBLGen Pro, and I find the forums to be of an excellent quality and the product seems good too.
Thanks in advance,
Paul