Beispiel #1
0
 public virtual CheckCommandResult CanDelete()
 {
     if (DeleteCheckCommand == null)
     {
         return(true);
     }
     return(DeleteCheckCommand.Execute(this as T));
 }
Beispiel #2
0
 protected virtual void EnforceDeletable()
 {
     if (DeleteCheckCommand != null)
     {
         var result = DeleteCheckCommand.ExecuteDatabaseCheckOnly(this as T);
         if (!result.Allowed)
         {
             var message = result.CreateMessage(CslaBaseMessages.NotAllowedToDelete);
             throw new NotAllowedException(message);
         }
     }
 }