Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
[HttpPost]
public IActionResult Create([FromBody] TodoItem item)
{
if (item == null)
{
return BadRequest();
}
_todoRepository.Add(item);
return CreatedAtRoute("GetTodo", new { id = item.Key }, item);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment