Inheritance: IUriFactory
        public Endpoint Build()
        {
            var clientFactory = _clientFactory ?? new DefaultHttpClientFactory();
            var serializer = _serializer ?? new JsonSerializer();
            var oDataQueryFactory = _oDataQueryFactory ?? new DefaultODataQueryFactory();

            var uriFactory = new UriFactory(_uri);
            var httpService = new HttpService(clientFactory, serializer);
            var restQueryableFactory = new RestQueryableFactory(httpService, new RestQueryModelVisitor(oDataQueryFactory));

            return new Endpoint(restQueryableFactory, httpService, uriFactory);
        }
Beispiel #2
0
        public void TestSetUp()
        {
            _host = TestServer.Create<Startup>();

            var uriFactory = new UriFactory(new Uri("http://localhost:6789/api/"));
            var queryFactory = new DefaultODataQueryFactory();

            var httpService = new RequestBuilderHttpService(_host);

            var queryModelTranslator = new RestQueryModelVisitor(queryFactory);

            var restQueryableFactory = new RestQueryableFactory(httpService, queryModelTranslator);

            _endpoint = new Endpoint(restQueryableFactory, httpService, uriFactory);
        }