1234567891011121314151617181920212223242526272829303132333435 |
- using Swashbuckle.Extension.Mvc;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Http;
- using System.Web.Http.Description;
- using System.Web.Mvc;
- using System.Web.Optimization;
- using System.Web.Routing;
- using TF.Config;
- namespace TfRiskControlApi
- {
- public class MvcApplication : System.Web.HttpApplication
- {
- protected void Application_Start()
- {
- //¼ÓÔØÅäÖÃÎļþ
- if (!ConfigManager.LoadConfig())
- {
- throw new Exception("Load config failed.");
- }
- var assembly = typeof(TfRiskControlApi.MvcApplication).Assembly;
- var apiExplorer = new MvcApiExplorer(assembly, GlobalConfiguration.Configuration);
- GlobalConfiguration.Configuration.Services.Replace(typeof(IApiExplorer), apiExplorer);
- AreaRegistration.RegisterAllAreas();
- FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
- RouteConfig.RegisterRoutes(RouteTable.Routes);
- BundleConfig.RegisterBundles(BundleTable.Bundles);
- }
- }
- }
|