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 lines
967 B

  1. using Microsoft.AspNetCore.Builder;
  2. using Microsoft.Extensions.Configuration;
  3. using Microsoft.Extensions.DependencyInjection;
  4. namespace Samples.Redis.SqlServer
  5. {
  6. public class Startup
  7. {
  8. public Startup(IConfiguration configuration)
  9. {
  10. Configuration = configuration;
  11. }
  12. public IConfiguration Configuration { get; }
  13. public void ConfigureServices(IServiceCollection services)
  14. {
  15. services.AddControllers();
  16. services.AddCap(options =>
  17. {
  18. options.UseRedis("redis-node-0:6379,password=cap");
  19. options.UseSqlServer("Server=db;Database=master;User=sa;Password=P@ssw0rd;");
  20. });
  21. }
  22. public void Configure(IApplicationBuilder app)
  23. {
  24. app.UseRouting();
  25. app.UseEndpoints(endpoints =>
  26. {
  27. endpoints.MapControllers();
  28. });
  29. }
  30. }
  31. }