public ICollection <EventDto> FindEventsByKeywordsAndCategory(String name, long categoryId, int startIndex, int count) { if (cachingProvider.GetItem(name, false) != null) { ICollection <Event> events = (ICollection <Event>)cachingProvider.GetItem(name, false); cachingProvider.AddItem(name, events); ICollection <EventDto> eventsDto = new HashSet <EventDto>(); foreach (Event e in events) { eventsDto.Add(new EventDto(e)); } return(eventsDto); } else { String[] keywords = name.Split(' '); ICollection <Event> events = EventDao.FindByKeywordsAndCategory(keywords, categoryId, startIndex, count); cachingProvider.AddItem(name, events); ICollection <EventDto> eventsDto = new HashSet <EventDto>(); foreach (Event e in events) { eventsDto.Add(new EventDto(e)); } return(eventsDto); } }
public ICollection <EventDto> FindEventsByKeywords(String name, int startIndex, int count) { String[] keywords = name.Split(' '); ICollection <Event> events = EventDao.FindByKeywordsAndCategory(keywords, -1, startIndex, count); ICollection <EventDto> eventsDto = new HashSet <EventDto>(); foreach (Event e in events) { eventsDto.Add(new EventDto(e)); } return(eventsDto); }