Ejemplo n.º 1
0
        public IActionResult SearchByCriteria([FromQuery(Name = "title")] string title)
        {
            var eventSearchDto = new EventSearchDto
            {
                Title = title
            };
            var events = _eventSearchService.FilterByCriteria(eventSearchDto);

            return(Ok(events));
        }
Ejemplo n.º 2
0
        public PaginationDto <EventDto> GetEvent(EventSearchDto searchDto)
        {
            var query = _context.Events.AsQueryable();

            if (!string.IsNullOrEmpty(searchDto.Title))
            {
                query = query.Where(c => c.Title.Contains(searchDto.Title));
            }

            var events = query.OrderByDescending(c => c.Id).ToPaginated(searchDto.PageNumber, searchDto.PageSize);

            return(events.ToDto());
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> List(EventSearchDto eventSearchDto)
        {
            var results = await searchService.SearchAll(eventSearchDto);

            return(Ok(results));
        }
Ejemplo n.º 4
0
 public IEnumerable <EventDto> FilterByCriteria(EventSearchDto eventSearchDto)
 {
     //var events = _eventDetailedSearch.SearchByCriteria(eventSearchDto);
     //var eventDtos = _mapper.Map<IEnumerable<EventDto>>(events);
     return(null);
 }