25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Startup.cs 862 B

12345678910111213141516171819202122232425262728293031323334
  1. using Microsoft.AspNetCore.Builder;
  2. using Microsoft.AspNetCore.Hosting;
  3. using Microsoft.Extensions.DependencyInjection;
  4. using Microsoft.Extensions.Logging;
  5. namespace Sample.RabbitMQ.MySql
  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("localhost");
  16. x.UseDashboard();
  17. });
  18. services.AddMvc();
  19. }
  20. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
  21. {
  22. loggerFactory.AddConsole();
  23. loggerFactory.AddDebug();
  24. app.UseMvc();
  25. app.UseCap();
  26. }
  27. }
  28. }