protected void Application_Start() { GlobalConfiguration.Configure(config => { WebApiConfig.Register(config); ODataConfig.Register(config); }); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); // GlobalConfiguration.Configure(WebApiConfig.Register); GlobalConfiguration.Configure(config => { ODataConfig.Register(config); //this has to be before WebApi WebApiConfig.Register(config); }); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); }
public static void Register(HttpConfiguration config) { config.Filters.Add(new AuthorizeAttribute()); config.Filters.Add(new DSWExceptionFilterAttribute()); // Web API configuration and services config.MapHttpAttributeRoutes(new DSWWebApiRouteProvider()); config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always; config.EnableCors(); ODataConfig.Register(config); config.EnableDependencyInjection(); config.EnsureInitialized(); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); UnityConfig.RegisterComponents(); GlobalConfiguration.Configure(config => { WebApiConfig.Register(config); ODataConfig.Register(config); //this has to be before WebApi }); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); log4net.Config.XmlConfigurator.Configure(); }
public static void StartWebApi(IAppBuilder app) { Database.SetInitializer(new MigrateDatabaseToLatestVersion <ShowcaseDbContext, Configuration>()); AutoMapperConfig.RegisterMappings(Assembly.Load(Constants.DataTransferModelsAssembly)); var httpConfig = new HttpConfiguration(); ODataConfig.Register(httpConfig); WebApiConfig.Register(httpConfig); httpConfig.EnsureInitialized(); app .UseNinjectMiddleware(NinjectConfig.CreateKernel) .UseNinjectWebApi(httpConfig); }