Ejemplo n.º 1
0
        public EventListViewModel GetPage(int page, EventListFilter filter)
        {
            var events = _unitOfWork.EventRepository.GetPage(ItemsPerPage, page, out var totalPages,
                                                             filter.OrderKeySelector, filter.IsDescending, filter.BuildFilters().ToArray());

            var pageViewModel = new PageViewModel(page, totalPages)
            {
                Parameters = filter.ToDictionary()
            };

            var model = new EventListViewModel
            {
                Events          = events,
                Page            = pageViewModel,
                EventCategories = _unitOfWork.EventCategoryRepository.All()
            };

            return(model);
        }
Ejemplo n.º 2
0
 public IEnumerable <Event> GetList(EventListFilter filter)
 {
     return(_unitOfWork.EventRepository.All(filter.BuildFilters().ToArray()));
 }