public override void Alter(ActionCall call) { call.AddBefore(new ChromeNode(_contentType) { Title = () => Title }); }
public void Configure(BehaviorGraph graph) { graph.Services.SetServiceIfNone <IAntiForgeryValidator, AntiForgeryValidator>(); graph.Services.SetServiceIfNone <IAntiForgeryEncoder, MachineKeyAntiForgeryEncoder>(); graph.Services.SetServiceIfNone <IAntiForgerySerializer, BinaryAntiForgerySerializer>(); graph.Services.SetServiceIfNone <IAntiForgeryTokenProvider, AntiForgeryTokenProvider>(); graph.Services.SetServiceIfNone <IAntiForgeryService, AntiForgeryService>(); graph.Behaviors.Each(b => { ActionCall call = b.FirstCall(); call.ForAttributes <AntiForgeryTokenAttribute>(a => call.AddBefore(new AntiForgeryNode(a.Salt))); }); }
public static void ApplyValidation(ActionCall call, ValidationSettings settings) { BehaviorNode node; if (call.ResourceType().CanBeCastTo <AjaxContinuation>()) { node = new AjaxValidationNode(call); } else { var builder = typeof(LoFiValidationNodeBuilder <>).CloseAndBuildAs <IValidationNodeBuilder>(call.InputType()); node = builder.BuildNode(); } call.AddBefore(node); settings.As <IChainModification>().Modify(call.ParentChain()); }
public override void Alter(ActionCall call) { var filter = new ActionFilter(_filterType, _method); call.AddBefore(filter); }
public override void Alter(ActionCall call) { call.AddBefore(new ChromeNode(_contentType)); }
public override void Alter(ActionCall call) { call.AddBefore(new AntiForgeryNode(Salt)); }