public async Task DeleteToDo(int id) { var request = new DeleteToDoParameter() { Id = id }; await UserClient.DeleteToDoAsync(request); await GetToDoList(); }
// Delete to-do in the list public async Task DeleteToDo(int id) { var toDoList = new ToDoItemList(); var request = new DeleteToDoParameter() { Id = id }; toDoList.ToDoList.RemoveAt(id); await UserClient.DeleteToDoAsync(request); }
public override async Task <Empty> DeleteToDo(DeleteToDoParameter request, ServerCallContext context) { var response = new Empty(); var item = (from data in _dataContext.ToDoDb where data.Id == request.Id select data).Single(); _dataContext.ToDoDb.Remove(item); var result = await _dataContext.SaveChangesAsync(); return(await Task.FromResult(response)); }