public async Task <ActionResult <ClothesColors> > PostClothesColors(ClothesColors clothesColors) { _context.ClothesColors.Add(clothesColors); await _context.SaveChangesAsync(); return(CreatedAtAction("GetClothesColors", new { id = clothesColors.Id }, clothesColors)); }
public async Task <IActionResult> PutClothesColors(int id, ClothesColors clothesColors) { if (id != clothesColors.Id) { return(BadRequest()); } _context.Entry(clothesColors).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClothesColorsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }