You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

37 rivejä
966 B

  1. using System;
  2. using DotNetCore.CAP.Internal;
  3. using Microsoft.Extensions.DependencyInjection;
  4. using Microsoft.Extensions.Logging;
  5. namespace Sample.ConsoleApp
  6. {
  7. public class Program
  8. {
  9. public static void Main(string[] args)
  10. {
  11. var container = new ServiceCollection();
  12. container.AddLogging(x => x.AddConsole());
  13. container.AddCap(x =>
  14. {
  15. //console app does not support dashboard
  16. x.UseMySql("<ConnectionString>");
  17. x.UseRabbitMQ(z =>
  18. {
  19. z.HostName = "192.168.3.57";
  20. z.UserName = "user";
  21. z.Password = "wJ0p5gSs17";
  22. });
  23. });
  24. container.AddSingleton<EventSubscriber>();
  25. var sp = container.BuildServiceProvider();
  26. sp.GetService<IBootstrapper>().BootstrapAsync();
  27. Console.ReadLine();
  28. }
  29. }
  30. }