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

12345678910111213141516171819202122232425262728293031323334353637
  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. }