Exemplo n.º 1
0
        internal static IEnumerable <TodoListViewModel> GetTodoLists()
        {
            var headers = new Dictionary <string, string>();

            headers["X-accessToken"] = AccessToken;

            var httpRequester = new HttpRequester(BaseServicesUrl);

            var todoListsModels =
                httpRequester.Get <IEnumerable <TodolistModel> >("lists", headers);

            return(todoListsModels.
                   AsQueryable().
                   Select(model => new TodoListViewModel()
            {
                Id = model.Id,
                Title = model.Title,
                Todos = model.Todos.AsQueryable().Select(todo => new TodoViewModel()
                {
                    Id = todo.Id,
                    Text = todo.Text,
                    IsDone = todo.IsDone
                })
            }));
        }
Exemplo n.º 2
0
        internal static IEnumerable <AppointmentViewModel> GetAllAppointments()
        {
            var headers = new Dictionary <string, string>();

            headers["X-accessToken"] = AccessToken;

            var httpRequester = new HttpRequester(BaseServicesUrl);

            return(httpRequester.
                   Get <IEnumerable <AppointmentViewModel> >("appointments/all", headers));
        }