public OperationResult Create(Dish dish) { try { _dao.Create(dish); return(new OperationResult() { Success = true }); } catch (Exception e) { return(new OperationResult() { Success = false, Exception = e }); } }
public virtual OperationResult Create(Dish dish) { try { using var transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionOptions, TransactionScopeAsyncFlowOption.Enabled); _dao.Create(dish); transactionScope.Complete(); return(new OperationResult <List <Dish> > { Success = true }); } catch (Exception e) { return(new OperationResult <List <Dish> >() { Success = false, Exception = e }); } }