Пример #1
0
        public IEnumerable <OrganisationSummary> GetAllOrganisations()
        {
            var take = _queryHelper.GetOrganisationsTotalAmount();

            var searchDescriptor = GetAllAssessmentOrgsSearchDescriptor(take);

            var results =
                _elasticsearchCustomClient.Search <OrganisationDocument>(
                    s =>
                    searchDescriptor);

            if (results.ApiCall.HttpStatusCode != 200)
            {
                throw new ApplicationException("Failed query all organisations");
            }

            return(results.Documents.Select(organisation => _assessmentOrgsMapping.MapToOrganisationDto(organisation)).ToList());
        }