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.
 
 
 

33 line
820 B

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