public ListDTO <List <Library> > LibraryList(int page, int limit) { long size = libraryRepository.Count(); if (page < 1) { page = 1; } if (limit < 1) { limit = 1; } var libraries = libraryRepository.List(page, limit); return(new ListDTO <List <Library> >(libraries, page, Util.CountPages(size, limit))); }