public async Task <ActionResult <AssignCategories> > PostAssignCategories(AssignCategories assignCategories) { _context.AssignCategories.Add(assignCategories); await _context.SaveChangesAsync(); return(CreatedAtAction("GetAssignCategories", new { id = assignCategories.AssignCategoryId }, assignCategories)); }
public async Task <IActionResult> PutAssignCategories(int id, AssignCategories assignCategories) { if (id != assignCategories.AssignCategoryId) { return(BadRequest()); } _context.Entry(assignCategories).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AssignCategoriesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }