Exemple #1
0
 private ServiceCache()
 {
     _instanceCache = new InstanceCache();
     _dict = new Dictionary<RouteAttribute, MethodInfo>();
     foreach (var a in WebServiceConfig.WebServiceConfiguration.Assemblies)
     {
         foreach (Type t in a.GetTypes())
         {
             if (t.Implemented(typeof(IRESTfulApi)))
             {
                 foreach (MethodInfo method in t.GetMethods())
                 {
                     var route = method.GetSingleAttribute<RouteAttribute>();
                     if (route != null)
                         _dict[route] = method;
                 }
             }
         }
     }
 }
Exemple #2
0
 private ServiceCache()
 {
     _instanceCache = new InstanceCache();
     _dict          = new Dictionary <RouteAttribute, MethodInfo>();
     foreach (var a in WebServiceConfig.WebServiceConfiguration.Assemblies)
     {
         foreach (Type t in a.GetTypes())
         {
             if (t.Implemented(typeof(IRESTfulApi)))
             {
                 foreach (MethodInfo method in t.GetMethods())
                 {
                     var route = method.GetSingleAttribute <RouteAttribute>();
                     if (route != null)
                     {
                         _dict[route] = method;
                     }
                 }
             }
         }
     }
 }