Exemple #1
0
        public async Task <int> AddExpenseToMonthlyBudgetBoard(Expense request)
        {
            await _midasContext.Expense.AddAsync(request);

            await _midasContext.SaveChangesAsync();

            return(request.ExpenseId);
        }
Exemple #2
0
        public async Task <bool> CreateExpense(ExpenseCreate request)
        {
            var entity = _mapper.Map <Expense>(request);

            await _midasContext.Expense.AddAsync(entity);

            return(await _midasContext.SaveChangesAsync() == 1);
        }
Exemple #3
0
        public async Task <int> AddMonthlyExpenseToBudgetBoard(MonthlyExpenseModel request)
        {
            var entity = _mapper.Map <MonthlyExpense>(request);

            await _midasContext.MonthlyExpense.AddAsync(entity);

            await _midasContext.SaveChangesAsync();

            return(entity.MonthlyExpenseId);
        }
Exemple #4
0
        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);
        }