public IActionResult SaveItem(ToDoItemDto model) { if (model.Id == Guid.Empty) { model.Id = Guid.NewGuid(); _toDoItemService.Add(model); } else { _toDoItemService.Update(model); } return(Ok()); }
public async Task <IActionResult> UpdateItem(ToDoItemToAdd itemToAdd, Guid itemId) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } await _itemService.Update(itemId, itemToAdd); return(StatusCode(204)); }
public IActionResult UpdateCard(ToDoItem entity) { _toDoItemService.Update(entity); return(RedirectToAction("Index")); }