Ejemplo n.º 1
0
 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 }
         );
 }
Ejemplo n.º 2
0
 public SystemModuleController()
 {
     moduleService = MyUnity.GetService <ISystemModuleService>();
 }
Ejemplo n.º 3
0
 public SystemUserController()
 {
     userService = MyUnity.GetService <ISystemUserService>();
 }