Пример #1
0
 public IEnumerable <BookInfoViewModel> GetBooks(PageData pageData, SortByProperty sortBy, bool descreasing)
 {
     return(_booksRepository.GetBooks(new PaginationData
     {
         PageNumber = pageData.PageNum,
         PageSize = pageData.PageSize,
         SortBy = sortBy,
         OrderByDescending = descreasing
     }).Select(bi => new BookInfoViewModel
     {
         Id = bi.Id,
         Title = bi.Title,
         AuthorFirstName = bi.AuthorFirstName,
         AuthorLastName = bi.AuthorLastName,
         PublicationYear = bi.PublicationYear
     }));
 }
Пример #2
0
 public void SetSortingProperty(SortByProperty sortByProperty)
 {
     Settings.SortBy = sortByProperty;
     _settingsRepository.SaveSettings(Settings);
 }