Пример #1
0
        public virtual async Task DeleteGroup(ToDoGroupDto group, CancellationToken cancellationToken)
        {
            await ODataClient
            .For <ToDoGroupDto>("ToDoGroups")
            .Key(group.Id)
            .DeleteEntryAsync(cancellationToken);

            ToDoGroups.Remove(group);
        }
Пример #2
0
        public virtual async Task <ToDoGroupDto> AddNewGroup(string groupTitle, CancellationToken cancellationToken)
        {
            ToDoGroupDto addedToDoGroup = await ODataClient
                                          .For <ToDoGroupDto>("ToDoGroups")
                                          .Action("CreateToDoGroup")
                                          .Set(new { title = groupTitle })
                                          .ExecuteAsSingleAsync(cancellationToken);

            ToDoGroups.Add(addedToDoGroup);
            return(addedToDoGroup);
        }