public static void RegisterNorthwind( HttpConfiguration config, HttpServer server) { config.MapRestierRoute<NorthwindApi>( "NorthwindApi", "api/Northwind", new RestierBatchHandler(server)); }
public static void Register(HttpConfiguration config) { config.MapRestierRoute<TrippinApi>( "TrippinApi", "api/Trippin", new RestierBatchHandler(GlobalConfiguration.DefaultServer)).Wait(); }
public DynamicControllerTests() { if (ConfigurationManager.AppSettings["TestServiceURL"] != null) { testServiceURL = ConfigurationManager.AppSettings["TestServiceURL"]; } if (string.IsNullOrEmpty(testServiceURL)) { testServiceURL = cDefaultBaseURL; var configuration = new HttpConfiguration(); configuration.MapRestierRoute<DynamicApi>("DynamicApi", "DynamicApi").Wait(); client = new HttpClient(new HttpServer(configuration)); } else { var handler = new HttpClientHandler { UseDefaultCredentials = true }; client = new HttpClient(handler); } if (client != null) client.Timeout = TimeSpan.FromMinutes(10); if (!testServiceURL.EndsWith("/")) { testServiceURL += "/"; } }
public static async void RegisterTrippin( HttpConfiguration config, HttpServer server) { await config.MapRestierRoute<TrippinApi>( "TrippinApi", "api/Trippin", new RestierBatchHandler(server)); }
public static async void RegisterSpatial( HttpConfiguration config, HttpServer server) { await config.MapRestierRoute<SpatialApi>( "SpatialApi", "api/spatial2", new RestierBatchHandler(server)); }
public static void RegisterNorthwind( HttpConfiguration config, HttpServer server) { config.Filter().Expand().Select().OrderBy().MaxTop(null).Count(); config.SetUseVerboseErrors(true); config.MapRestierRoute<NorthwindApi>( "NorthwindApi", "api/Northwind", new RestierBatchHandler(server)); }
public static async void RegisterTrippin( HttpConfiguration config, HttpServer server) { // enable query options for all properties config.Filter().Expand().Select().OrderBy().MaxTop(null).Count(); await config.MapRestierRoute<TrippinApi>( "TrippinApi", "api/Trippin", new RestierBatchHandler(server)); }
public static async void RegisterAdventureWorks(HttpConfiguration config, HttpServer server) { // enable query options for all properties config.Filter().Expand().Select().OrderBy().MaxTop(null).Count(); await config.MapRestierRoute<EntityFrameworkApi<AdventureWorksContext>>( "AdventureWorksLT", "api/AdventureWorksLT", new RestierBatchHandler(server) ); }
/// <summary> Registers the dynamic. </summary> /// /// <param name="config"> The configuration. </param> /// <param name="server"> The server. </param> public static async void RegisterDynamic(HttpConfiguration config, HttpServer server) { System.Web.OData.Routing.ODataRoute odataRoute = await config.MapRestierRoute<DynamicApi>( "DynamicApi", "api/Dynamic", new RestierBatchHandler(server)); //for overriding standart metadata class //System.Web.OData.MetadataController odataRoute.PathRouteConstraint.RoutingConventions.Add(new MediadataRoutingConvention()); // Register an Action selector that can include template parameters in the name IHttpActionSelector actionSelectorService = config.Services.GetActionSelector(); config.Services.Replace(typeof(IHttpActionSelector), new DynamicODataActionSelector(actionSelectorService)); // Register an Action invoker that can include template parameters in the name IHttpActionInvoker actionInvokerService = config.Services.GetActionInvoker(); config.Services.Replace(typeof(IHttpActionInvoker), new DynamicODataActionInvoker(actionInvokerService)); // Register an Exception handler that can include template parameters in the name IExceptionHandler exceptionHandler = config.Services.GetExceptionHandler(); config.Services.Replace(typeof(IExceptionHandler), new DynamicExceptionHandler(exceptionHandler)); }
public static void Register(HttpConfiguration config) { // Web API configuration and services // Web API routes config.MapHttpAttributeRoutes(); //var builder = new ODataConventionModelBuilder(); //builder.EntitySet<Customer>("Customers"); //builder.EntitySet<CustomerDemographic>("CustomerDemographics"); //builder.EntitySet<Order>("Orders"); //var model = builder.GetEdmModel(); //config.MapODataServiceRoute("odata", "odata", model); // config.MapRestierRoute<DbApi<NorthwindContext>>("odata", "odata"); config.MapRestierRoute<NorthwindApi>("odata", "odata"); config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); }
public MediaDataControllerTests() { if (ConfigurationManager.AppSettings["TestServiceURL"] != null) { testServiceURL = ConfigurationManager.AppSettings["TestServiceURL"]; } if (string.IsNullOrEmpty(testServiceURL)) { testServiceURL = DynamicControllerTests.cDefaultBaseURL; var configuration = new HttpConfiguration(); Task<System.Web.OData.Routing.ODataRoute> odataRoute = configuration.MapRestierRoute<DynamicApi>("DynamicApi", "DynamicApi"); odataRoute.Wait(); odataRoute.Result.PathRouteConstraint.RoutingConventions.Add(new ODataRestierDynamic.DynamicFactory.MediadataRoutingConvention()); // Register an Action selector that can include template parameters in the name IHttpActionSelector actionSelectorService = configuration.Services.GetActionSelector(); configuration.Services.Replace(typeof(IHttpActionSelector), new DynamicODataActionSelector(actionSelectorService)); // Register an Action invoker that can include template parameters in the name IHttpActionInvoker actionInvokerService = configuration.Services.GetActionInvoker(); configuration.Services.Replace(typeof(IHttpActionInvoker), new DynamicODataActionInvoker(actionInvokerService)); client = new HttpClient(new HttpServer(configuration)); } else { var handler = new HttpClientHandler { UseDefaultCredentials = true }; client = new HttpClient(handler); } if (!testServiceURL.EndsWith("/")) { testServiceURL += "/"; } }
public FallbackTests() { var configuration = new HttpConfiguration(); configuration.MapRestierRoute<FallbackApi>("fallback", "fallback").Wait(); client = new HttpClient(new HttpServer(configuration)); }
public ExceptionHandlerTests() { var configuration = new HttpConfiguration(); configuration.MapRestierRoute<ExcApi>("Exc", "Exc").Wait(); client = new HttpClient(new HttpServer(configuration)); }
private static async void RegisterApi(HttpConfiguration config, HttpServer server) { await config.MapRestierRoute<PrimitivesApi>( "PrimitivesApi", "api/Prim", new RestierBatchHandler(server)); }
private static async void Configuration(IAppBuilder appBuilder) { var config = new HttpConfiguration { IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always }; var server = new HttpServer(config); appBuilder.UseWebApi(server); config.EnableSwagger(c => { // Use "SingleApiVersion" to describe a single version API. Swagger 2.0 includes an "Info" object to // hold additional metadata for an API. Version and title are required but you can also provide // additional fields by chaining methods off SingleApiVersion. // c.SingleApiVersion("v1", "A title for your API"); // Wrap the default SwaggerGenerator with additional behavior (e.g. caching) or provide an // alternative implementation for ISwaggerProvider with the CustomProvider option. // c.CustomProvider(defaultProvider => new ODataSwaggerProvider(defaultProvider, c, config)); }).EnableSwaggerUi(); FormatterConfig.Register(config); config.Services.Replace(typeof(IHttpControllerSelector), new RestierControllerSelector(config)); await config.MapRestierRoute<EntityFrameworkApi<TestRestierODataContext>>("RESTierRoute", "restier", new RestierBatchHandler(server)); config.EnsureInitialized(); }
public static async void Register(HttpConfiguration config) { ResetDataSource(); await config.MapRestierRoute<DbApi<DemoContext>>("OData", "demo", new RestierBatchHandler(GlobalConfiguration.DefaultServer)); }
public RestierQueryBuilderTests() { var configuration = new HttpConfiguration(); configuration.MapRestierRoute<StoreApi>("store", "store").Wait(); client = new HttpClient(new HttpServer(configuration)); }
private static async void ConfigureRestierOData(HttpConfiguration config) { await config.MapRestierRoute<DbApi<RestierODataContext>>("RESTierRoute", "restier", new RestierBatchHandler(GlobalConfiguration.DefaultServer)); }
private static async void ConfigureRestierOData(HttpConfiguration config) { config.Filter().Expand().Select().OrderBy().MaxTop(null).Count(); await config.MapRestierRoute<EntityFrameworkApi<RestierODataContext>>("RESTierRoute", "restier", new RestierBatchHandler(GlobalConfiguration.DefaultServer)); }