Files
Yi.Framework/Yi.Furion.Net6/Yi.Framework.Infrastructure/Sqlsugar/SqlsugarExtensions.cs
2023-04-15 17:35:22 +08:00

20 lines
557 B
C#

using Microsoft.Extensions.DependencyInjection;
namespace Yi.Framework.Infrastructure.Sqlsugar
{
/// <summary>
/// 这一块,需要做成上下文对象,会进行重构
/// </summary>
public static class SqlsugarExtensions
{
//使用上下文对象
public static void AddDbSqlsugarContextServer(this IServiceCollection services)
{
services.AddSingleton(x => x.GetRequiredService<SqlSugarDbContext>().SqlSugarClient);
services.AddSingleton<SqlSugarDbContext>();
}
}
}