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