本文整理汇总了C#中FubuMVC.Core.FubuRegistry类的典型用法代码示例。如果您正苦于以下问题:C# FubuRegistry类的具体用法?C# FubuRegistry怎么用?C# FubuRegistry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FubuRegistry类属于FubuMVC.Core命名空间,在下文中一共展示了FubuRegistry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetUp
public void SetUp()
{
registry = new FubuRegistry(x =>
{
x.Actions.IncludeTypes(t => false);
// Tell FubuMVC to wrap the behavior chain for each
// RouteHandler with the "FakeUnitOfWorkBehavior"
// Kind of like a global [ActionFilter] in MVC
x.Policies.ConditionallyWrapBehaviorChainsWith<FakeUnitOfWorkBehavior>(
call => call.Method.Name == "SomeAction");
// Explicit junk you would only do for exception cases to
// override the conventions
x.Route("area/sub/{Name}/{Age}")
.Calls<TestController>(c => c.SomeAction(null)).OutputToJson();
x.Route("area/sub2/{Name}/{Age}")
.Calls<TestController>(c => c.AnotherAction(null)).OutputToJson();
x.Route("area/sub3/{Name}/{Age}")
.Calls<TestController>(c => c.ThirdAction(null)).OutputToJson();
});
_graph = BehaviorGraph.BuildFrom(registry);
}
示例2: alter_settings_modifies_settings_object
public void alter_settings_modifies_settings_object()
{
var registry = new FubuRegistry(r => r.AlterSettings<SettingsObject>(so => so.Touched = true));
BehaviorGraph.BuildFrom(registry)
.Settings.Get<SettingsObject>().Touched.ShouldBeTrue();
}
示例3: configure
protected override void configure(FubuRegistry registry)
{
registry.Actions.IncludeType<HelloRazorController>();
registry.Views
.TryToAttachWithDefaultConventions();
}
示例4: SetUp
public void SetUp()
{
var registry = new FubuRegistry(x =>
{
//x.Route("some/route").Calls<ReportController>(o => o.BuildReport()).OutputToText();
});
}
示例5: SetUp
public void SetUp()
{
var registry = new FubuRegistry();
registry.Actions.IncludeType<JsonController>();
theGraph = registry.BuildGraph();
}
示例6: SetUp
public void SetUp()
{
var registry = new FubuRegistry();
registry.Actions.IncludeType<RouteAliasController>();
theGraph = BehaviorGraph.BuildFrom(registry);
}
示例7:
void IFubuRegistryExtension.Configure(FubuRegistry registry)
{
registry.Actions.FindWith<GoogleEndpoints>();
registry.Services<GoogleServiceRegistry>();
registry.Policies.Add<AttachDefaultGoogleView>();
registry.Extensions().For(new OAuth2ContentExtension<GoogleLoginRequest>());
}
示例8: configure
protected virtual void configure(FubuRegistry registry)
{
registry.Actions.IncludeType<SampleController>();
registry.AlterSettings<AuthenticationSettings>(
_ => _.Strategies.AddToEnd(MembershipNode.For<InMemoryMembershipRepository>()));
}
示例9: SetUp
public void SetUp()
{
var registry = new FubuRegistry();
registry.Features.ServerSentEvents.Enable(true);
theGraph = BehaviorGraph.BuildFrom(registry);
}
示例10: SetUp
public void SetUp()
{
var registry = new FubuRegistry();
registry.Features.Localization.Enable(true);
graphWithBasicLocalizationAsIs = BehaviorGraph.BuildFrom(registry);
}
示例11: SetUp
public void SetUp()
{
AssetDeclarationVerificationActivator.Latched = true;
registry = new FubuRegistry(x =>
{
x.Route("area/sub/{Name}/{Age}")
.Calls<TestController>(c => c.AnotherAction(null)).OutputToJson();
x.Route("area/sub2/prop")
.Calls<TestController>(c => c.SomeAction(null)).OutputToJson();
x.Route("area/sub2/{Name}/{Age}")
.Calls<TestController>(c => c.AnotherAction(null)).OutputToJson();
x.Route("area/sub2/{Name}")
.Calls<TestController>(c => c.ThirdAction(null)).OutputToJson();
x.Route("area/sub3/{Name}/{Age}")
.Calls<TestController>(c => c.AnotherAction(null)).OutputToJson();
x.Route("area/sub4/some_pattern")
.Calls<TestController>(c => c.AnotherAction(null)).OutputToJson();
});
container = new Container();
routes = FubuApplication.For(registry).StructureMap(container).Bootstrap().Where(r => !r.As<Route>().Url.StartsWith("_content")).ToList();
container.Configure(x => x.For<IOutputWriter>().Use(new InMemoryOutputWriter()));
Debug.WriteLine(container.WhatDoIHave());
}
示例12: SetUp
public void SetUp()
{
var registry = new FubuRegistry();
registry.Import<YuiCompressionExtensions>();
theServices = BehaviorGraph.BuildFrom(registry).Services;
}
示例13: Configure
public void Configure(FubuRegistry registry)
{
registry
.Actions
.FindWith<ExplicitControllerRegistration>();
registry
.Views
.TryToAttachWithDefaultConventions()
.TryToAttachViewsInPackages();
registry
.UseSpark(spark => spark.ConfigureComposer(c => c.AddBinder<DiagnosticsTemplateBinder>()));
registry.Configure(graph =>
{
var chain = graph.FindHomeChain();
if (chain == null)
{
graph
.BehaviorFor<GettingStartedController>(x => x.Execute(new GettingStartedRequestModel()))
.Route = new RouteDefinition(string.Empty);
}
});
}
示例14: SetUp
public void SetUp()
{
registry = new FubuRegistry(x =>
{
// Tell FubuMVC to enrich the behavior chain for each
// RouteHandler with the "FakeUnitOfWorkBehavior"
// Kind of like a global [ActionFilter] in MVC
x.Policies.EnrichCallsWith<FakeUnitOfWorkBehavior>(
call => call.Method.Name == "SomeAction");
// Explicit junk you would only do for exception cases to
// override the conventions
x.Route<InputModel>("area/sub/{Name}/{Age}")
.Calls<TestController>(c => c.SomeAction(null)).OutputToJson();
x.Route<InputModel>("area/sub2/{Name}/{Age}")
.Calls<TestController>(c => c.AnotherAction(null)).OutputToJson();
x.Route<InputModel>("area/sub3/{Name}/{Age}")
.Calls<TestController>(c => c.ThirdAction(null)).OutputToJson();
});
_graph = registry.BuildGraph();
}
示例15: SetUp
public void SetUp()
{
registry = new FubuRegistry(x =>
{
x.Route<InputModel>("area/sub/{Name}/{Age}")
.Calls<TestController>(c => c.AnotherAction(null)).OutputToJson();
x.Route<InputModel>("area/sub2/prop")
.Calls<TestController>(c => c.SomeAction(null)).OutputToJson();
x.Route<InputModel>("area/sub2/{Name}/{Age}")
.Calls<TestController>(c => c.AnotherAction(null)).OutputToJson();
x.Route<InputModel>("area/sub2/{Name}")
.Calls<TestController>(c => c.ThirdAction(null)).OutputToJson();
x.Route<InputModel>("area/sub3/{Name}/{Age}")
.Calls<TestController>(c => c.AnotherAction(null)).OutputToJson();
});
container = new Container();
var bootstrapper = new StructureMapBootstrapper(container, registry);
routes = new RouteCollection();
bootstrapper.Bootstrap(routes);
container.Configure(x => x.For<IOutputWriter>().Use(new InMemoryOutputWriter()));
Debug.WriteLine(container.WhatDoIHave());
}