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