您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

7 年前
7 年前
7 年前
7 年前
7 年前
12345678910111213141516171819202122232425262728293031323334353637
  1. using Microsoft.AspNetCore.Builder;
  2. using Microsoft.AspNetCore.Hosting;
  3. using Microsoft.Extensions.DependencyInjection;
  4. using Microsoft.Extensions.Logging;
  5. namespace Sample.RabbitMQ.SqlServer
  6. {
  7. public class Startup
  8. {
  9. public void ConfigureServices(IServiceCollection services)
  10. {
  11. services.AddDbContext<AppDbContext>();
  12. services.AddCap(x =>
  13. {
  14. x.UseEntityFramework<AppDbContext>();
  15. x.UseRabbitMQ(y=> {
  16. y.HostName = "192.168.2.206";
  17. y.UserName = "admin";
  18. y.Password = "123123";
  19. });
  20. });
  21. services.AddMvc();
  22. }
  23. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
  24. {
  25. loggerFactory.AddConsole();
  26. loggerFactory.AddDebug();
  27. app.UseMvc();
  28. app.UseCap();
  29. }
  30. }
  31. }