コード例 #1
0
        public async Task DeleteToDo(int id)
        {
            var request = new DeleteToDoParameter()
            {
                Id = id
            };

            await UserClient.DeleteToDoAsync(request);

            await GetToDoList();
        }
コード例 #2
0
        // 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);
        }
コード例 #3
0
        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));
        }