Example #1
0
        public async Task Init()
        {
            try
            {
                object currentUserId = 0;

                Application.Current.Properties.TryGetValue("id", out currentUserId);

                var searchRequest = new UserBooksSearchRequest()
                {
                    UserId                = (int)currentUserId,
                    FinishedOn            = null,
                    IsBooksLoadingEnabled = true,
                    IsUsersLoadingEnabled = true,
                    FinishedWithReading   = false
                };

                var entities = await _readingListService.Get <List <Model.Models.UserBook> >(searchRequest);

                CurrentlyReading.Clear();
                entities.ForEach((entity) => CurrentlyReading.Add(entity));
            }
            catch (System.Exception)
            {
                throw;
            }
        }
        public async Task Init()
        {
            try
            {
                object currentUserId = 0;

                Application.Current.Properties.TryGetValue("id", out currentUserId);

                var searchRequest = new UserBooksSearchRequest()
                {
                    UserId                = (int)currentUserId,
                    FinishedOn            = DateTime.Now,
                    IsBooksLoadingEnabled = true,
                    IsUsersLoadingEnabled = true
                };

                var entities = await _readingListService.Get <List <Model.Models.UserBook> >(searchRequest);

                PreviousReadings.Clear();
                entities.ForEach((entity) => PreviousReadings.Add(entity));
            }
            catch (System.Exception)
            {
            }
        }