public async Task <ActionResult <EntriesModelInput> > PostEntriesModelInput(EntriesModelInput entriesModelInput) { _context.EntriesModel.Add(entriesModelInput); await _context.SaveChangesAsync(); return(CreatedAtAction("GetEntriesModelInput", new { id = entriesModelInput.Id }, entriesModelInput)); }
public async Task <IActionResult> PutEntriesModelInput(int id, EntriesModelInput entriesModelInput) { if (id != entriesModelInput.Id) { return(BadRequest()); } _context.Entry(entriesModelInput).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EntriesModelInputExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }