本文整理匯總了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);
}