Advertisement
Guest User

Untitled

a guest
Sep 30th, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. namespace Sfa.Demo.Nsb.Client
  2. {
  3. using System;
  4.  
  5. using NServiceBus;
  6.  
  7. using Sfa.Demo.Nsb.Common.Commands;
  8. using Sfa.Demo.Nsb.Client.ConsoleExtension;
  9. using Sfa.Demo.Nsb.Client.Helper;
  10.  
  11. public class Program
  12. {
  13. public static void Main(string[] args)
  14. {
  15. Console.Title = "Demo.Client";
  16.  
  17. var busConfig = BusConfigurator.GetBusConfiguration();
  18. busConfig.EnableInstallers();
  19.  
  20. Console.WriteLine("Starting NServiceBus...");
  21. BusConfigurator.Bus = Bus.Create(busConfig).Start();
  22. Console.WriteLine("NServiceBus started successfully.");
  23.  
  24. // code for sending a command, using the bus instance created earler.
  25. BusConfigurator.Bus.Send<SayHelloCommand>(cmd => { cmd.MyName = "My name"; });
  26.  
  27. BusConfigurator.Bus.Dispose();
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement