Inheritance: IUriFactory
Exemplo n.º 1
0
        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);
        }
Exemplo n.º 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);
        }