public static void Register(HttpConfiguration config) { // Web API configuration and services // Configure Web API to use only bearer token authentication. config.SuppressDefaultHostAuthentication(); config.Filters.Add(new HostAuthenticationFilter(OAuthDefaults.AuthenticationType)); // my config //var cors = new EnableCorsAttribute("*", "*", "*"); //config.EnableCors(); // Web API routes config.MapHttpAttributeRoutes(); MyUnity.RegisterService(); config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); }
public SystemModuleController() { moduleService = MyUnity.GetService <ISystemModuleService>(); }
public SystemUserController() { userService = MyUnity.GetService <ISystemUserService>(); }