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