public OperationResult Delete(Dish dish) { try { _dao.Delete(dish); return(new OperationResult() { Success = true }); } catch (Exception e) { return(new OperationResult() { Success = false, Exception = e }); } }
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 }); } }