Пример #1
0
 private async Task <IEnumerable <CustomerQueryModel> > GetAllCustomersAsync(GetAllCustomersQuery query)
 {
     return((await _elasticClient.SearchAsync <CustomerQueryModel>(i => i
                                                                   .Index(IndexName)
                                                                   .WithPagination(query.PageIndex, query.PageSize)
                                                                   ))
            .Hits
            .Select(hit => hit.Source));
 }
Пример #2
0
        /// <inheritdoc />
        public override async Task <IEnumerable <GetAllCustomersQueryResult> > HandleAsync(GetAllCustomersQuery query)
        {
            var customers = await GetAllCustomersAsync(query);

            var queryResult = MapToQueryResult(customers);

            return(queryResult);
        }