當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。