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.
 
 
 

38 rivejä
925 B

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Threading.Tasks;
  5. using Microsoft.AspNetCore.Builder;
  6. using Microsoft.AspNetCore.Hosting;
  7. using Microsoft.Extensions.DependencyInjection;
  8. using Microsoft.Extensions.Logging;
  9. namespace Sample.RabbitMQ.MySql
  10. {
  11. public class Startup
  12. {
  13. public void ConfigureServices(IServiceCollection services)
  14. {
  15. services.AddDbContext<AppDbContext>();
  16. services.AddCap(x =>
  17. {
  18. x.UseEntityFramework<AppDbContext>();
  19. x.UseRabbitMQ("localhost");
  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. }