public async Task <IActionResult> PutExpense(int id, ExpenseDto expenseDto) { if (id != expenseDto.Id) { return(BadRequest()); } _context.Entry(expenseDto).State = EntityState.Modified; await _context.SaveChangesAsync(); return(NoContent()); }
public async Task <IActionResult> PutCapitalItem(int id, CapitalDto capitalDto) { if (id != capitalDto.Id) { return(BadRequest()); } _context.Entry(capitalDto).State = EntityState.Modified; await _context.SaveChangesAsync(); return(NoContent()); }
public void AddCapital(CapitalDto capitalDto) { var capital = this._mapper.Map <Capital>(capitalDto); _context.Capitals.AddAsync(capital); _context.SaveChangesAsync(); }