本文整理汇总了C#中BusConfiguration.LoadMessageHandlers方法的典型用法代码示例。如果您正苦于以下问题:C# BusConfiguration.LoadMessageHandlers方法的具体用法?C# BusConfiguration.LoadMessageHandlers怎么用?C# BusConfiguration.LoadMessageHandlers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BusConfiguration
的用法示例。
在下文中一共展示了BusConfiguration.LoadMessageHandlers方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Simple
void Simple(BusConfiguration busConfiguration)
{
#region HandlerOrderingWithCode
busConfiguration.LoadMessageHandlers(First<HandlerB>.Then<HandlerA>().AndThen<HandlerC>());
#endregion
}
示例2: Application_Start
protected void Application_Start(object sender, EventArgs e)
{
var configuration = new BusConfiguration();
configuration.DisableFeature<CriticalTimeMonitoring>();
configuration.DisableFeature<SLAMonitoring>();
configuration.LoadMessageHandlers<First<UserAuthenticatedHandler>>();
configuration.UsePersistence<InMemoryPersistence>();
Bus = NServiceBus.Bus.Create(configuration).Start();
}
示例3: Simple
public void Simple()
{
#region HandlerOrderingWithFluentV5
var configuration = new BusConfiguration();
configuration.LoadMessageHandlers(First<HandlerB>.Then<HandlerA>().AndThen<HandlerC>());
#endregion
}
示例4: Main
static void Main( string[] args )
{
var cfg = new BusConfiguration();
cfg.UniquelyIdentifyRunningInstance()
.UsingCustomIdentifier( new Guid( "{41E0F4CE-A4AE-4A30-8F78-B4CC3E912ABD}" ) );
cfg.EnableInstallers();
var embeddedSore = new EmbeddableDocumentStore
{
ResourceManagerId = new Guid( "{46FFEA87-77A7-43A7-88D3-79778E677D52}" ),
DataDirectory = @"~\RavenDB\Data"
}.Initialize();
cfg.UsePersistence<RavenDBPersistence>()
.DoNotSetupDatabasePermissions()
.SetDefaultDocumentStore( embeddedSore );
cfg.Conventions()
.DefiningCommandsAs( t => t.Namespace != null && t.Namespace.EndsWith( ".Commands" ) )
.DefiningEventsAs( t => t.Namespace != null && t.Namespace.EndsWith( ".Events" ) );
cfg.LoadMessageHandlers(
First<Handlers.SecurityHandler>
.Then<Handlers.ValidationHandler>()
);
using( var bus = Bus.Create( cfg ).Start() )
{
bus.SendLocal( new Commands.StartSagaCommand()
{
Sample = "Hi, there!"
} );
Console.Read();
}
}