public async Task <IActionResult> PutElectronicItemCategory(Guid id, ElectronicItemCategory electronicItemCategory) { if (id != electronicItemCategory.Id) { return(BadRequest()); } _context.Entry(electronicItemCategory).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ElectronicItemCategoryExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <ElectronicItemCategory> > PostElectronicItemCategory(ElectronicItemCategory electronicItemCategory) { _context.ElectronicItemCategories.Add(electronicItemCategory); await _context.SaveChangesAsync(); return(CreatedAtAction("GetElectronicItemCategory", new { id = electronicItemCategory.Id }, electronicItemCategory)); }