public AggregatedRoute() { RequestMethods = new List<string>(); Handlers = new LiaraMessageHandlerCollection(); Conditions = new List<Func<LiaraContext, bool>>(); RouteItems = new Dictionary<string, object>(); }
public AggregatedRoute() { RequestMethods = new List <string>(); Handlers = new LiaraMessageHandlerCollection(); Conditions = new List <Func <LiaraContext, bool> >(); RouteItems = new Dictionary <string, object>(); }
public LiaraMessageHandlerCollection GetRouteHandlerCollection(MethodInfo method) { var routeHandlers = new LiaraMessageHandlerCollection(); dynamic declaringType = method; if (declaringType != null) { var modulesInScope = explorer.GetLiaraModules(); var allowAnonymous = false; do { object[] handlers = declaringType.GetCustomAttributes(typeof(LiaraMessageHandler), false); if (handlers.Length <= 0) { continue; } foreach ( LiaraMessageHandler handler in handlers.OrderByDescending(h => ((LiaraMessageHandler)h).Order)) { var type = handler.GetType(); if (allowAnonymous) { if (type == typeof(Authorize)) { continue; } } if (type == typeof(AllowAnonymous)) { allowAnonymous = true; continue; } routeHandlers.Insert(0, handler); } } while ((declaringType = declaringType.DeclaringType) != null && modulesInScope.Any(m => m.GetType() == declaringType)); } routeHandlers.Add((LiaraMessageHandler)explorer.GetConfiguration().ActionInvoker); return(routeHandlers); }
public LiaraMessageHandlerCollection GetRouteHandlerCollection(MethodInfo method) { var routeHandlers = new LiaraMessageHandlerCollection(); dynamic declaringType = method; if (declaringType != null) { var modulesInScope = explorer.GetLiaraModules(); var allowAnonymous = false; do { object[] handlers = declaringType.GetCustomAttributes(typeof (LiaraMessageHandler), false); if (handlers.Length <= 0) continue; foreach ( LiaraMessageHandler handler in handlers.OrderByDescending(h => ((LiaraMessageHandler) h).Order)) { var type = handler.GetType(); if (allowAnonymous) { if (type == typeof (Authorize)) { continue; } } if (type == typeof (AllowAnonymous)) { allowAnonymous = true; continue; } routeHandlers.Insert(0, handler); } } while ((declaringType = declaringType.DeclaringType) != null && modulesInScope.Any(m => m.GetType() == declaringType)); } routeHandlers.Add((LiaraMessageHandler)explorer.GetConfiguration().ActionInvoker); return routeHandlers; }
public LiaraConfiguration() { handlers = new LiaraMessageHandlerCollection(); formatters = new LiaraFormatterCollection(); Items = new LiaraHashTable<object>(isCaseSensitive: true); }
public LiaraConfiguration() { handlers = new LiaraMessageHandlerCollection(); formatters = new LiaraFormatterCollection(); Items = new LiaraHashTable <object>(isCaseSensitive: true); }
public Route() { Id = Guid.NewGuid(); Handlers = new LiaraMessageHandlerCollection(); Parameters = new Dictionary <string, string>(); }
public Route() { Id = Guid.NewGuid(); Handlers = new LiaraMessageHandlerCollection(); Parameters = new Dictionary<string, string>(); }