当前位置: 首页>>代码示例>>C#>>正文


C# BehaviorChain.ToArray方法代码示例

本文整理汇总了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>));
        }
开发者ID:RyanHauert,项目名称:fubumvc,代码行数:14,代码来源:ValidationConventionTester.cs

示例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>();
        }
开发者ID:RyanHauert,项目名称:fubumvc,代码行数:14,代码来源:ValidationConventionTester.cs

示例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>();
        }
开发者ID:thunklife,项目名称:fubuvalidation,代码行数:15,代码来源:ValidationConventionTester.cs

示例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>));
        }
开发者ID:thunklife,项目名称:fubuvalidation,代码行数:16,代码来源:ValidationConventionTester.cs

示例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)));
 }
开发者ID:joshuaflanagan,项目名称:fubumvc,代码行数:6,代码来源:DiagnosticBehaviorPrepender.cs

示例6: modifyChain

 private static void modifyChain(BehaviorChain chain)
 {
     chain.ToArray().Each(node => node.InsertDirectlyBefore(Wrapper.For<BehaviorTracer>()));
     chain.Prepend(new Wrapper(typeof (DiagnosticBehavior)));
 }
开发者ID:bbehrens,项目名称:fubumvc,代码行数:5,代码来源:DiagnosticBehaviorPrepender.cs


注:本文中的BehaviorChain.ToArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。