public async Task <ActionResult <ClothesSizes> > PostClothesSizes(ClothesSizes clothesSizes) { _context.ClothesSizes.Add(clothesSizes); await _context.SaveChangesAsync(); return(CreatedAtAction("GetClothesSizes", new { id = clothesSizes.Id }, clothesSizes)); }
public async Task <IActionResult> PutClothesSizes(int id, ClothesSizes clothesSizes) { if (id != clothesSizes.Id) { return(BadRequest()); } _context.Entry(clothesSizes).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClothesSizesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }