Exemple #1
0
        public IActionResult Put(Guid id, [FromBody] Models.Task task)
        {
            var updated = Repository.UpdateTask(id, task);

            if (updated == null)
            {
                return(NotFound());
            }
            return(Json(updated));
        }
Exemple #2
0
        public IActionResult Post([FromBody] Models.Task task)
        {
            var created = Repository.CreateTask(task);

            return(CreatedAtRoute("GetTask", new { id = created.Id }, created));
        }