public async Task <IActionResult> EditOutgoing(int id, [FromBody] ApiOutgoing model) { var outgoing = await _uow.Outgoings.GetByIdAsync(id); outgoing.Budgeted = model.Budgeted; _uow.Outgoings.Update(outgoing); await _uow.CommitAsync(); return(new JsonResult(model)); }
public async Task <IActionResult> EditOutgoing(int id, [FromBody] ApiOutgoing model) { var outgoing = _uow.Outgoings.GetAll() .Where(x => x.UserId == Token.UserId) .Where(x => x.Id == id) .FirstOrDefault(); if (outgoing != null) { outgoing.DateModified = DateTime.UtcNow; outgoing.Budgeted = model.Budgeted; _uow.Outgoings.Update(outgoing); await _uow.CommitAsync(); return(new OkResult()); } return(new NotFoundResult()); }