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


C# BehaviorGraph.Actions方法代码示例

本文整理汇总了C#中BehaviorGraph.Actions方法的典型用法代码示例。如果您正苦于以下问题:C# BehaviorGraph.Actions方法的具体用法?C# BehaviorGraph.Actions怎么用?C# BehaviorGraph.Actions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BehaviorGraph的用法示例。


在下文中一共展示了BehaviorGraph.Actions方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Configure

 public void Configure(BehaviorGraph graph)
 {
     graph
         .Actions()
         .Where(action => action.IsCrudAction())
         .Each(action => action.AddBefore(new CrudValidationBehaviorNode(action.InputType())));
 }
开发者ID:jmlopez,项目名称:Valcon,代码行数:7,代码来源:CrudValidationConvention.cs

示例2: Configure

 public void Configure(BehaviorGraph graph)
 {
     graph.Actions().Each(a =>
     {
         a.ForAttributes<UrlRegistryCategoryAttribute>(att => a.ParentChain().UrlCategory.Category = att.Category);
     });
 }
开发者ID:RobertTheGrey,项目名称:fubumvc,代码行数:7,代码来源:UrlRegistryCategoryConvention.cs

示例3: Configure

        public void Configure(BehaviorGraph graph)
        {
            var discoveredViewTokens = _facilities.SelectMany(x => x.FindViews(_types));
            var bag = new ViewBag(discoveredViewTokens);

            graph.Actions().Each(a => attachView(bag, a));
        }
开发者ID:shashankshetty,项目名称:fubumvc,代码行数:7,代码来源:ViewAttacher.cs

示例4: Configure

 public void Configure(BehaviorGraph graph)
 {
     graph.Actions()
         .Where(x => x.Method.Name.StartsWith("Orchestrates") || x.Method.Name.StartsWith("Initiates"))
         .Where(x => x.InputType().GetProperties().Any(y => y.Name.Equals("CorrelationId")))
         .Each(x => x.WrapWith(typeof(SagaFindByIdBehavior<,>).MakeGenericType(x.HandlerType, x.HandlerType.GetProperty("State").PropertyType)));
 }
开发者ID:ahjohannessen,项目名称:fubutransportation-spike,代码行数:7,代码来源:SagaFindByIdConvention.cs

示例5: Configure

 public void Configure(BehaviorGraph graph)
 {
     graph.Actions()
         .Where(x => x.InputType().CanBeCastTo<JsonMessage>())
         .ToList()
         .Each(x => x.ParentChain().MakeAsymmetricJson());
 }
开发者ID:jemacom,项目名称:fubumvc,代码行数:7,代码来源:JsonMessageInputConvention.cs

示例6: can_prepend_behaviors_in_front_of_an_action_4

        public void can_prepend_behaviors_in_front_of_an_action_4()
        {
            graph = BehaviorGraph.BuildFrom(x =>
            {
                x.Actions.IncludeTypesNamed(o => o.EndsWith("Controller"));

                x.Policies.AlterActions(a => a.WrapWith<MyWrapper>());
            });

            graph.Actions().Each(x => x.WrapWith(typeof(MyWrapper)));

            graph.Actions().Each(x =>
            {
                x.Previous.ShouldBeOfType<Wrapper>().BehaviorType.ShouldEqual(typeof(MyWrapper));
            });
        }
开发者ID:roend83,项目名称:fubumvc,代码行数:16,代码来源:attaching_behaviors_to_action_calls.cs

示例7: Configure

        public void Configure(BehaviorGraph graph)
        {
            var views = _facilities.SelectMany(x => x.FindViews(_types));
            var bag = new ViewBag(views);

            graph.Actions().Each(a => AttemptToAttachViewToAction(bag, a, graph.Observer));
        }
开发者ID:codereflection,项目名称:fubumvc,代码行数:7,代码来源:ViewAttacher.cs

示例8: Configure

        public void Configure(BehaviorGraph graph)
        {
            IEnumerable<IViewToken> views = _facilities.SelectMany(x => x.FindViews(_types));
            var bag = new ViewBag(views);

            graph.Actions().Each(a => { attachView(bag, a); });
        }
开发者ID:bbehrens,项目名称:fubumvc,代码行数:7,代码来源:ViewAttacher.cs

示例9: Configure

 public void Configure(BehaviorGraph graph)
 {
     graph
         .Actions()
         .Where(c => !c.HandlerType.Namespace.Contains("Login") && !c.HandlerType.Namespace.Contains("Home"))
         .Each(c => c.WrapWith<AuthenticationRequiredBehavior>());
 }
开发者ID:henninga,项目名称:FubuDate,代码行数:7,代码来源:AuthenticationConvention.cs

示例10: Configure

 public void Configure(BehaviorGraph graph)
 {
     graph
         .Actions()
         .Where(action => action.IsCrudAction())
         .Each(action => action.AddBefore(new CrudErrorWrapperBehaviorNode()));
 }
开发者ID:jmlopez,项目名称:Valcon,代码行数:7,代码来源:CrudErrorWrapperConvention.cs

示例11: Configure

		public void Configure(BehaviorGraph graph)
		{
			graph
			.Actions()
			.Where(b => b.InputType() != null && b.InputType().Namespace.ToLower().Contains("sitemanagement"))
			.Each(chain => chain.WrapWith<NTCodingAuthenticationBehaviour>());
		}
开发者ID:NTCoding,项目名称:FubuRaven.NTCoding.com,代码行数:7,代码来源:AuthenticationConvention.cs

示例12: Configure

 public void Configure(BehaviorGraph graph)
 {
     graph
         .Actions()
         .Where(c => c.HasAttribute<SecureAttribute>())
         .Each(c => c.WrapWith<AuthenticationRequiredBehaviour>());
 }
开发者ID:chester89,项目名称:FubuSamples,代码行数:7,代码来源:AuthenticationConvention.cs

示例13: Configure

 public void Configure(BehaviorGraph graph)
 {
     //graph.Services.ServicesFor(typeof(IValidator<>).MakeGenericType(x.InputType()))
     graph.Actions()
         .Where(x => x.HasInput && ObjectFactory.Model.HasDefaultImplementationFor(typeof(IValidator<>).MakeGenericType(x.InputType())))
         .Each(x => x.AddBefore(new Wrapper(typeof(ValidationBehaviour<>).MakeGenericType(x.InputType()))));
 }
开发者ID:chester89,项目名称:FubuSamples,代码行数:7,代码来源:ValidationConfiguration.cs

示例14: Configure

 public void Configure(BehaviorGraph graph)
 {
     graph
         .Actions()
         .Where(action => action.InputType().IsAuthenticatedAPIRequest())
         .Each(action => action.ParentChain().Authorization.AddPolicy(new AuthenticationTokenAuthorizationPolicy()));
 }
开发者ID:modulexcite,项目名称:dovetail-bootstrap,代码行数:7,代码来源:AuthenticationTokenConvention.cs

示例15: Configure

 public void Configure(BehaviorGraph graph)
 {
     graph
         .Actions()
         .Where(ShouldBePartial)
         .Select(x => x.ParentChain())
         .Each(x => x.IsPartialOnly = true);
 }
开发者ID:roend83,项目名称:fubumvc,代码行数:8,代码来源:PartialOnlyConvention.cs


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