Exemplo n.º 1
0
        static async Task Main(string[] args)
        {
            var endpointConfiguration = NServiceBusHelper.GetEndpointConfiguration("Client.EventsListener");
            var endpointInstance      = await Endpoint.Start(endpointConfiguration);

            Console.WriteLine("Press any key to exit");
            Console.ReadKey();
            await endpointInstance.Stop();
        }
Exemplo n.º 2
0
 // Additional configuration is required to successfully run gRPC on macOS.
 // For instructions on how to configure Kestrel and gRPC clients on macOS, visit https://go.microsoft.com/fwlink/?linkid=2099682
 public static IHostBuilder CreateHostBuilder(string[] args) =>
 Host.CreateDefaultBuilder(args)
 .UseServiceProviderFactory(new AutofacServiceProviderFactory(configAction => {
     configAction.RegisterInstance <ITodoItemRepository>(new InMemoryTodoItemRepository());
     configAction.RegisterType <TodoGrpcService>();
     configAction.RegisterType <NServiceBus.NServiceBus>().As <IBus>();
 }))
 .UseMicrosoftLogFactoryLogging()
 .UseNServiceBus(hostBuilderContext =>
 {
     var endpointConfiguration = NServiceBusHelper.GetEndpointConfiguration("TodoService");
     return(endpointConfiguration);
 })
 .ConfigureWebHostDefaults(webBuilder =>
 {
     webBuilder.UseStartup <Startup>();
 })
 ;