public override void Alter(ActionCallBase call) { if (call is ActionCall) { var chain = call.ParentChain(); var alias = call.As <ActionCall>().BuildRouteForPattern(_pattern); chain.As <RoutedChain>().AddRouteAlias(alias); } }
private static void AppendMethod(IRouteDefinition route, ActionCallBase call, IEnumerable <PropertyInfo> properties, IEnumerable <Regex> ignore) { var part = RemovePattern(call.Method.Name, ignore); Append(route, properties, part); if (call.HasInput) { route.ApplyInputType(call.InputType()); } }
public override void Alter(ActionCallBase call) { if (call is ActionCall) { var chain = call.ParentChain(); var alias = call.As<ActionCall>().BuildRouteForPattern(_pattern); chain.As<RoutedChain>().AddRouteAlias(alias); } }
public static bool IsRedirectable(ActionCallBase action) { var outputType = action.OutputType(); if (outputType == null) { return(false); } return(outputType.CanBeCastTo <FubuContinuation>() || outputType.CanBeCastTo <IRedirectable>()); }
private static void ConstrainToHttpMethod( IRouteDefinition route, ActionCallBase call, IEnumerable<Configuration.HttpConstraintPattern> patterns) { Func<Configuration.Segment, string> getName = s => { switch (s) { case Configuration.Segment.Namespace: return call.HandlerType.Namespace; case Configuration.Segment.Class: return call.HandlerType.Name; case Configuration.Segment.Method: return call.Method.Name; } return null; }; patterns.Where(x => x.Regex.IsMatch(getName(x.Type))).ToList(). ForEach(x => route.AddHttpMethodConstraint(x.Method)); }
private static void ConstrainToHttpMethod( IRouteDefinition route, ActionCallBase call, IEnumerable <Configuration.HttpConstraintPattern> patterns) { Func <Configuration.Segment, string> getName = s => { switch (s) { case Configuration.Segment.Namespace: return(call.HandlerType.Namespace); case Configuration.Segment.Class: return(call.HandlerType.Name); case Configuration.Segment.Method: return(call.Method.Name); } return(null); }; patterns.Where(x => x.Regex.IsMatch(getName(x.Type))).ToList(). ForEach(x => route.AddHttpMethodConstraint(x.Method)); }
public override void Alter(ActionCallBase call) { call.ParentChain().Authorization.AddPolicy(new MustBeAuthenticated()); }
public override void Alter(ActionCallBase call) { call.ParentChain().As <RoutedChain>().UrlCategory.Category = Category; }
public override void Alter(ActionCallBase call) { var chain = call.ParentChain(); _roles.Each(role => chain.Authorization.AddPolicy(new RequireRole(role))); }
public override void Alter(ActionCallBase call) { var filter = new ActionFilter(_filterType, _method); call.AddBefore(filter); }
public override void Alter(ActionCallBase call) { var inputNode = call.ParentChain().Input; _types.Each(inputNode.Add); }
private static void AppendMethod(IRouteDefinition route, ActionCallBase call, IEnumerable<PropertyInfo> properties, IEnumerable<Regex> ignore) { var part = RemovePattern(call.Method.Name, ignore); Append(route, properties, part); if (call.HasInput) route.ApplyInputType(call.InputType()); }
public override void Alter(ActionCallBase call) { call.AddBefore(new AntiForgeryNode(Salt)); }
private static void AppendNamespace(IRouteDefinition route, ActionCallBase call, IEnumerable<PropertyInfo> properties, IEnumerable<Regex> ignore) { var parts = RemovePattern(call.HandlerType.Namespace, ignore).Split('.').ToArray(); Append(route, properties, parts); }
private static void AppendClass(IRouteDefinition route, ActionCallBase call, IEnumerable<PropertyInfo> properties, IEnumerable<Regex> ignore) { var part = RemovePattern(call.HandlerType.Name, ignore); Append(route, properties, part); }
public override void Alter(ActionCallBase call) { var authorizationNode = call.ParentChain().Authorization; Types.Each(authorizationNode.Add); }
public override void Alter(ActionCallBase call) { var authorizationNode = call.ParentChain().Authorization; _roles.Each(r => authorizationNode.AddRole(r)); }
public override void Alter(ActionCallBase call) { call.Chain.ApplyCompression(); }
public override void Alter(ActionCallBase call) { call.ParentChain().Authorization.FailureHandler(_type); }
public override void Alter(ActionCallBase call) { _behaviorTypes.Each(x => call.WrapWith(x)); }
public override void Alter(ActionCallBase call) { call.ParentChain().As <RoutedChain>().UrlCategory.Creates.Add(Type); }
public override void Alter(ActionCallBase call) { var outputNode = call.ParentChain().Output; _types.Each(t => outputNode.Add(t)); }
public override void Alter(ActionCallBase call) { var chain = call.ParentChain(); chain.Prepend(ActionFilter.For <PassThroughAuthenticationFilter>(a => a.Filter())); }
private static void AppendNamespace(IRouteDefinition route, ActionCallBase call, IEnumerable <PropertyInfo> properties, IEnumerable <Regex> ignore) { var parts = RemovePattern(call.HandlerType.Namespace, ignore).Split('.').ToArray(); Append(route, properties, parts); }
public override void Alter(ActionCallBase call) { call.ParentChain().InsertFirst(Wrapper.For <WonkyWrapper>()); }
public override void Alter(ActionCallBase call) { call.ParentChain().As<RoutedChain>().UrlCategory.Creates.Add(Type); }
public override void Alter(ActionCallBase call) { call.ParentChain().Input.Add(typeof(NewtonSoftBindingReader<>)); }
public abstract void Alter(ActionCallBase call);
public override void Alter(ActionCallBase call) { call.ParentChain().As<RoutedChain>().UrlCategory.Category = Category; }
public override void Alter(ActionCallBase call) { var chain = call.ParentChain(); chain.Tags.Fill(_tags); }
private static void AppendClass(IRouteDefinition route, ActionCallBase call, IEnumerable <PropertyInfo> properties, IEnumerable <Regex> ignore) { var part = RemovePattern(call.HandlerType.Name, ignore); Append(route, properties, part); }
public override void Alter(ActionCallBase call) { var chain = call.ParentChain(); chain.Prepend(ActionFilter.For<PassThroughAuthenticationFilter>(a => a.Filter())); }
public override void Alter(ActionCallBase call) { call.ParentChain().Input.Add(typeof(NewtonSoftBindingReader <>)); }