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