本文整理汇总了C#中BehaviorChain.ToArray方法的典型用法代码示例。如果您正苦于以下问题:C# BehaviorChain.ToArray方法的具体用法?C# BehaviorChain.ToArray怎么用?C# BehaviorChain.ToArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BehaviorChain
的用法示例。
在下文中一共展示了BehaviorChain.ToArray方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: adds_validation_action_filter_for_lofi_endpoints
public void adds_validation_action_filter_for_lofi_endpoints()
{
var call = ActionCall.For<SampleInputModel>(x => x.Test(null));
var chain = new BehaviorChain();
chain.AddToEnd(call);
ValidationPolicy.ApplyValidation(call, new ValidationSettings());
var nodes = chain.ToArray();
var node = nodes[0].As<IHaveValidation>();
node.As<ActionFilter>().HandlerType.ShouldBe(typeof (ValidationActionFilter<string>));
}
示例2: adds_ajax_validation_action_filter_for_ajax_endpoints
public void adds_ajax_validation_action_filter_for_ajax_endpoints()
{
var call = ActionCall.For<SampleAjaxModel>(x => x.post_model(null));
var chain = new BehaviorChain();
chain.AddToEnd(call);
ValidationPolicy.ApplyValidation(call, new ValidationSettings());
var nodes = chain.ToArray();
var node = nodes[0].As<IHaveValidation>();
node.ShouldBeOfType<AjaxValidationNode>();
}
示例3: adds_ajax_validation_action_filter_for_ajax_endpoints
public void adds_ajax_validation_action_filter_for_ajax_endpoints()
{
var call = ActionCall.For<SampleAjaxModel>(x => x.post_model(null));
var chain = new BehaviorChain();
chain.AddToEnd(call);
ValidationConvention.ApplyValidation(call);
var nodes = chain.ToArray();
var node = nodes[0].As<ValidationNode>();
node.Mode.ShouldEqual(ValidationMode.Ajax);
node.ShouldBeOfType<AjaxValidationNode>();
}
示例4: adds_validation_action_filter_for_lofi_endpoints
public void adds_validation_action_filter_for_lofi_endpoints()
{
var call = ActionCall.For<SampleInputModel>(x => x.Test(null));
var chain = new BehaviorChain();
chain.AddToEnd(call);
ValidationConvention.ApplyValidation(call);
var nodes = chain.ToArray();
var node = nodes[0].As<ValidationNode>();
node.Mode.ShouldEqual(ValidationMode.LoFi);
node.As<ActionFilter>().HandlerType.ShouldEqual(typeof (ValidationActionFilter<string>));
}
示例5: modifyChain
private static void modifyChain(BehaviorChain chain, IConfigurationObserver observer)
{
chain.Calls.Each(c => observer.RecordCallStatus(c, "Wrapping with diagnostic tracer and behavior"));
chain.ToArray().Each(node => node.AddBefore(Wrapper.For<BehaviorTracer>()));
chain.Prepend(new Wrapper(typeof (DiagnosticBehavior)));
}
示例6: modifyChain
private static void modifyChain(BehaviorChain chain)
{
chain.ToArray().Each(node => node.InsertDirectlyBefore(Wrapper.For<BehaviorTracer>()));
chain.Prepend(new Wrapper(typeof (DiagnosticBehavior)));
}