fix 优化changeDb
This commit is contained in:
@@ -12,11 +12,9 @@ public class UserService : IUserService
|
||||
{
|
||||
private readonly IDbContext _dbContext;
|
||||
|
||||
public UserService(IDbContext dbContext, IConfiguration configuration)
|
||||
public UserService(IDbContext dbContext)
|
||||
{
|
||||
var identityConnection = configuration.GetSection("SqlSugarOptions:IdentityConnectionString").Value;
|
||||
dbContext.Client.CurrentConnectionConfig.ConnectionString = identityConnection;
|
||||
_dbContext = dbContext;
|
||||
_dbContext = dbContext.ChangeDb("identity");
|
||||
}
|
||||
|
||||
public async Task<Pagination<UserResponse>> GetPageAsync(UserPageRequest request)
|
||||
|
||||
@@ -16,7 +16,7 @@ public class SqlSugarPack : BaseAppPack
|
||||
|
||||
return new List<ConnectionConfig>
|
||||
{
|
||||
new ConnectionConfig
|
||||
new()
|
||||
{
|
||||
ConfigId = "identity",
|
||||
|
||||
|
||||
Reference in New Issue
Block a user