public async Task <IActionResult> PutLoaiSanPhamModel(int id, LoaiSanPhamModel loaiSanPhamModel) { if (id != loaiSanPhamModel.ID) { return(BadRequest()); } _context.Entry(loaiSanPhamModel).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LoaiSanPhamModelExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }