CloudGamingAdmin/admin-server/CloudGaming.Core.CAP/CoreCAPRedisStartup.cs
2024-11-15 02:58:48 +08:00

48 lines
1.6 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

namespace CloudGaming.Core.CAP;
public class CoreCAPRedisStartup : StartupModule<CoreCAPRedisStartup>
{
/// <summary>
///
/// </summary>
/// <param name="webApplicationBuilder"></param>
public override void ConfigureServices(WebApplicationBuilder webApplicationBuilder)
{
var services = webApplicationBuilder.Services;
webApplicationBuilder.Services.AddCap(x =>
{
//如果你使用的 EF 进行数据操作,你需要添加如下配置:
//x.UseEntityFramework<TDbContext>(); //可选项,你不需要再次配置 x.UseSqlServer 了
////如果你使用的ADO.NET根据数据库选择进行配置
//x.UseSqlServer("数据库连接字符串");
//x.UseMySql("数据库连接字符串");
//x.UsePostgreSql("数据库连接字符串");
////如果你使用的 MongoDB你可以添加如下配置
//x.UseMongoDB("ConnectionStrings"); //注意仅支持MongoDB 4.0+集群
////CAP支持 RabbitMQ、Kafka、AzureServiceBus、AmazonSQS 等作为MQ根据使用选择配置
//x.UseRabbitMQ("ConnectionStrings");
//x.UseKafka("ConnectionStrings");
//x.UseAzureServiceBus("ConnectionStrings");
//x.UseAmazonSQS();
// 内存消息队列
x.UseRedis();
});
}
/// <summary>
///
/// </summary>
/// <param name="webApplication"></param>
public override void Configure(WebApplication webApplication)
{
}
}