本文整理汇总了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())));
}
示例2: Configure
public void Configure(BehaviorGraph graph)
{
graph.Actions().Each(a =>
{
a.ForAttributes<UrlRegistryCategoryAttribute>(att => a.ParentChain().UrlCategory.Category = att.Category);
});
}
示例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));
}
示例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)));
}
示例5: Configure
public void Configure(BehaviorGraph graph)
{
graph.Actions()
.Where(x => x.InputType().CanBeCastTo<JsonMessage>())
.ToList()
.Each(x => x.ParentChain().MakeAsymmetricJson());
}
示例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));
});
}
示例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));
}
示例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); });
}
示例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>());
}
示例10: Configure
public void Configure(BehaviorGraph graph)
{
graph
.Actions()
.Where(action => action.IsCrudAction())
.Each(action => action.AddBefore(new CrudErrorWrapperBehaviorNode()));
}
示例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>());
}
示例12: Configure
public void Configure(BehaviorGraph graph)
{
graph
.Actions()
.Where(c => c.HasAttribute<SecureAttribute>())
.Each(c => c.WrapWith<AuthenticationRequiredBehaviour>());
}
示例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()))));
}
示例14: Configure
public void Configure(BehaviorGraph graph)
{
graph
.Actions()
.Where(action => action.InputType().IsAuthenticatedAPIRequest())
.Each(action => action.ParentChain().Authorization.AddPolicy(new AuthenticationTokenAuthorizationPolicy()));
}
示例15: Configure
public void Configure(BehaviorGraph graph)
{
graph
.Actions()
.Where(ShouldBePartial)
.Select(x => x.ParentChain())
.Each(x => x.IsPartialOnly = true);
}