public async Task <ActionResult <Category> > CreateCategory(Category category) { _context.Categories.Add(category); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCategory", new { id = category.Id }, category)); }
public async Task <ActionResult <Task> > CreateTask(Task task) { _context.Task.Add(task); await _context.SaveChangesAsync(); return(CreatedAtAction("GetTask", new { id = task.Id }, task)); }