public async Task <OperationResult> UpdateAsync(Restaurant item) { try { await _dao.UpdateAsync(item); return(new OperationResult() { Success = true }); } catch (Exception e) { return(new OperationResult() { Success = false, Exception = e }); } }
public async virtual Task <OperationResult> UpdateAsync(Restaurant restaurant) { try { using var transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionOptions, TransactionScopeAsyncFlowOption.Enabled); await _dao.UpdateAsync(restaurant); transactionScope.Complete(); return(new OperationResult <List <Restaurant> > { Success = true }); } catch (Exception e) { return(new OperationResult <List <Restaurant> >() { Success = false, Exception = e }); } }