public async Task <ActionResult <Sallon> > PostSallon(Sallon sallon) { _context.Sallon.Add(sallon); await _context.SaveChangesAsync(); return(CreatedAtAction("GetSallon", new { id = sallon.Sallon_ID }, sallon)); }
public async Task <IActionResult> PutSallon(int id, Sallon sallon) { if (id != sallon.Sallon_ID) { return(BadRequest()); } _context.Entry(sallon).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SallonExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }