public async Task <OperationStatus> FullUpdateTodoAsync(int id, TodoEditModel editModel) { var todo = await _todosRepository.GetTodoAsync(id); if (todo is null) { return(OperationStatus.EntityNotFound); } todo.Title = editModel.Title; todo.Description = editModel.Description; if (await _todosRepository.UpdateTodoAsync(todo)) { return(OperationStatus.Success); } return(OperationStatus.UnexpectedResult); }
protected override async Task OnInitializedAsync() { TodoEditModel = await ApiClient.GetFromJsonAsync <TodoEditModel>($"api/todos/{TodoId}"); }