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

            await _midasContext.SaveChangesAsync();

            return(request.ExpenseId);
        }
コード例 #2
0
ファイル: ExpenseService.cs プロジェクト: gngo2018/Midas_MVC
        public async Task <bool> CreateExpense(ExpenseCreate request)
        {
            var entity = _mapper.Map <Expense>(request);

            await _midasContext.Expense.AddAsync(entity);

            return(await _midasContext.SaveChangesAsync() == 1);
        }
コード例 #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);
        }
コード例 #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);
        }