public ITypeSearch<EpiFindNotice> CreateQuery(NoticesSearchOptions options) { SearchOptions = options; GetFilter = new FilterBuilder<EpiFindNotice>(_client); Query = _client.Search<EpiFindNotice>(); return Query; }
public ITypeSearch<EpiFindNotice> ApplyOrdering(ITypeSearch<EpiFindNotice> source, NoticesSearchOptions.SortOptions sortOptions) { switch (sortOptions) { case NoticesSearchOptions.SortOptions.Surname: return source.OrderBy(x => x.Surname); case NoticesSearchOptions.SortOptions.DateOfDeath: return source.OrderByDescending(x => x.DateOfDeath); } return source; }