public async Task <ActionResult <NomFiles> > PostNomFiles(NomFiles nomFiles) { _context.nomFiles.Add(nomFiles); await _context.SaveChangesAsync(); return(CreatedAtAction("GetNomFiles", new { id = nomFiles.Id }, nomFiles)); }
public async Task <IActionResult> PutNomFiles(int id, NomFiles nomFiles) { if (id != nomFiles.Id) { return(BadRequest()); } _context.Entry(nomFiles).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!NomFilesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }