/// <summary> /// Initializes a new instance of the <see cref="QueryController"/> class. /// </summary> public InsightController(IPagingHelper paging, IStorage storage, IMemoryCache cache, IOptions <InsightSettings> insightConfiguration, SyncConnection connection) { this.paging = paging; this.storage = storage; this.cache = cache; this.insightConfiguration = insightConfiguration.Value; syncConnection = connection; }
public BentoResourceController(IContentService contentService, IContentTypeService contentTypeService, IPagingHelper pagingHelper, IPluralizationServiceWrapper pluralizationServiceWrapper, IVariationContextAccessor variationContextAccessor) { _contentService = contentService; _contentTypeService = contentTypeService; _pagingHelper = pagingHelper; _pluralizationServiceWrapper = pluralizationServiceWrapper; _variationContextAccessor = variationContextAccessor; }
/// <summary> /// Initializes a new instance of the <see cref="QueryController"/> class. /// </summary> public CirrusQueryController(IPagingHelper paging, IComputeSmartContractService <DaoContractComputedTable> daoContractAggregator, ICirrusStorage cirrusMongoData, IComputeSmartContractService <StandardTokenComputedTable> standardTokenService, IComputeSmartContractService <NonFungibleTokenComputedTable> nonFungibleTokenService) { this.paging = paging; daoContractService = daoContractAggregator; this.cirrusMongoData = cirrusMongoData; this.standardTokenService = standardTokenService; this.nonFungibleTokenService = nonFungibleTokenService; }
public IndexModel( IAdminServices adminServices, ISessionTenantAccessor sessionTenantAccessor, IPagingHelper pagingHelper, ILogger <IndexModel> logger) { _adminServices = adminServices; _sessionTenantAccessor = sessionTenantAccessor; _pagingHelper = pagingHelper; _logger = logger; }
public ElasticSearchWrapper(IElasticClient esClient, IQueryFactory queryFactory, IPagingHelper pagingHelper, ISortFactory sortFactory, ILogger <ElasticSearchWrapper> logger, IIndexSelector indexSelector, IFilterFactory filterFactory) { _esClient = esClient; _queryFactory = queryFactory; _pagingHelper = pagingHelper; _sortFactory = sortFactory; _filterFactory = filterFactory; _logger = logger; _indexSelector = indexSelector; }
public PageEnvelope( long total, long page, int pageSize, string route, IEnumerable <T> data, HttpRequestMessage request, Dictionary <string, string> otherParams = null) { otherParams = otherParams == null?request.GetQueryNameValuePairs().ToDictionary(x => x.Key, x => x.Value) : otherParams; paginationHelper = new PagingHelper(request); var totalPages = (int)Math.Ceiling((double)total / pageSize); var nextPage = page < totalPages - 1 ? paginationHelper.GeneratePageUrl(route, page + 1, pageSize, otherParams) : string.Empty; var prevPage = page > 0 ? paginationHelper.GeneratePageUrl(route, page - 1, pageSize, otherParams) : string.Empty; this.pagination = new PaginationHeader(total, page, pageSize, data != null ? data.Count() : 0, nextPage, prevPage); this.data = data; }
static PagingHelper() { Instance = new PagingHelper(); }
/// <summary> /// Initializes a new instance of the <see cref="QueryController"/> class. /// </summary> public QueryController(IPagingHelper paging, IStorage storage) { this.paging = paging; this.storage = storage; }