private ODataQueryOptions GetODataQueryOptions(HttpRequest httpRequest)
        {
            var path = _oDataRequestHelper.GetODataPath(httpRequest);
            IEdmEntityTypeReference entityType = _oDataRequestHelper.GetEdmEntityTypeReference(httpRequest);
            var model        = _oDataRequestHelper.GetEdmModel(httpRequest);
            var queryOptions = new ODataQueryOptions(new ODataQueryContext(model, entityType.Definition, path), httpRequest);

            return(queryOptions);
        }
        protected void BeforeEachBenchmark(int recordCount)
        {
            var collection = new ServiceCollection();

            collection.AddOData();
            collection.AddODataQueryFilter();
            _provider = collection.BuildServiceProvider();
            var routeBuilder = new RouteBuilder(Mock.Of <IApplicationBuilder>(x => x.ApplicationServices == _provider));

            routeBuilder.EnableDependencyInjection();
            _oDataRequestHelper      = new ODataRequestHelper();
            _edmEntityTypeSettings   = GetEdmEntityTypeSettings();
            _httpContext             = new DefaultHttpContext();
            _genericEntityRepository = new GenericEntityRepository(recordCount);
            _oDataRequestHelper.GetEdmModel(_httpContext.Request, _edmEntityTypeSettings, EdmNamespaceName);
        }