public async Task <int> AddExpenseToMonthlyBudgetBoard(Expense request) { await _midasContext.Expense.AddAsync(request); await _midasContext.SaveChangesAsync(); return(request.ExpenseId); }
public async Task <bool> CreateExpense(ExpenseCreate request) { var entity = _mapper.Map <Expense>(request); await _midasContext.Expense.AddAsync(entity); return(await _midasContext.SaveChangesAsync() == 1); }
public async Task <int> AddMonthlyExpenseToBudgetBoard(MonthlyExpenseModel request) { var entity = _mapper.Map <MonthlyExpense>(request); await _midasContext.MonthlyExpense.AddAsync(entity); await _midasContext.SaveChangesAsync(); return(entity.MonthlyExpenseId); }
public async Task <bool> CreateBudgetBoard(BudgetBoardCreate request) { var fullRequest = CalculateTotalAmounts(request); var entity = _mapper.Map <BudgetBoard>(fullRequest); await _midasContext.BudgetBoard.AddAsync(entity); return(await _midasContext.SaveChangesAsync() == 1); }