public OperationResult Delete(Dish dish)
 {
     try
     {
         _dao.Delete(dish);
         return(new OperationResult()
         {
             Success = true
         });
     }
     catch (Exception e)
     {
         return(new OperationResult()
         {
             Success = false, Exception = e
         });
     }
 }
Esempio n. 2
0
 public virtual OperationResult Delete(Guid id)
 {
     try
     {
         using var transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionOptions, TransactionScopeAsyncFlowOption.Enabled);
         _dao.Delete(id);
         transactionScope.Complete();
         return(new OperationResult {
             Success = true
         });
     }
     catch (Exception e)
     {
         return(new OperationResult()
         {
             Success = false, Exception = e
         });
     }
 }