public async Task <IActionResult> PutEformations(long id, Eformations eformations) { if (id != eformations.EformationsId) { return(BadRequest()); } _context.Entry(eformations).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EformationsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Eformations> > PostEformations(Eformations eformations) { _context.Eformations.Add(eformations); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (EformationsExists(eformations.EformationsId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetEformations", new { id = eformations.EformationsId }, eformations)); }