feat: 完成swagger分组功能
This commit is contained in:
@@ -29,7 +29,7 @@ namespace Yi.Framework.SqlSugarCore.Repositories
|
||||
{
|
||||
|
||||
var db = (await _sugarDbContextProvider.GetDbContextAsync()).SqlSugarClient;
|
||||
await Console.Out.WriteLineAsync("获取的id:" + db.ContextID);
|
||||
//await Console.Out.WriteLineAsync("获取的id:" + db.ContextID);
|
||||
return db;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Yi.Framework.SqlSugarCore
|
||||
{
|
||||
public Task SaveAsync(AuditLogInfo auditInfo)
|
||||
{
|
||||
Console.WriteLine(auditInfo.ExecutionTime);
|
||||
//Console.WriteLine(auditInfo.ExecutionTime);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace Yi.Framework.SqlSugarCore.Uow
|
||||
{
|
||||
|
||||
var dbContext = await CreateDbContextAsync(unitOfWork);
|
||||
Console.WriteLine("111111:" + dbContext.SqlSugarClient.ContextID);
|
||||
// Console.WriteLine("111111:" + dbContext.SqlSugarClient.ContextID);
|
||||
return dbContext;
|
||||
}
|
||||
|
||||
@@ -101,14 +101,14 @@ namespace Yi.Framework.SqlSugarCore.Uow
|
||||
unitOfWork.AddTransactionApi(transactionApiKey, transaction);
|
||||
|
||||
|
||||
await Console.Out.WriteLineAsync("开始新的事务");
|
||||
//await Console.Out.WriteLineAsync("开始新的事务");
|
||||
Console.WriteLine(dbContext.SqlSugarClient.ContextID);
|
||||
await dbContext.SqlSugarClient.Ado.BeginTranAsync();
|
||||
return dbContext;
|
||||
}
|
||||
else
|
||||
{
|
||||
await Console.Out.WriteLineAsync("继续老的事务");
|
||||
// await Console.Out.WriteLineAsync("继续老的事务");
|
||||
Console.WriteLine(activeTransaction.DbContext.SqlSugarClient);
|
||||
await activeTransaction.DbContext.SqlSugarClient.Ado.BeginTranAsync();
|
||||
return (TDbContext)activeTransaction.DbContext;
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace Yi.Framework.SqlSugarCore
|
||||
{
|
||||
CodeFirst(service);
|
||||
}
|
||||
if (options.EnabledCodeFirst)
|
||||
if (options.EnabledDbSeed)
|
||||
{
|
||||
await DataSeedAsync(service);
|
||||
}
|
||||
@@ -70,9 +70,6 @@ namespace Yi.Framework.SqlSugarCore
|
||||
private void CodeFirst(IServiceProvider service)
|
||||
{
|
||||
|
||||
var options = service.GetRequiredService<IOptions<DbConnOptions>>().Value;
|
||||
if (options.EnabledCodeFirst)
|
||||
{
|
||||
var moduleContainer = service.GetRequiredService<IModuleContainer>();
|
||||
var db = service.GetRequiredService<ISqlSugarDbContext>().SqlSugarClient;
|
||||
|
||||
@@ -85,7 +82,7 @@ namespace Yi.Framework.SqlSugarCore
|
||||
{
|
||||
db.CodeFirst.InitTables(types.ToArray());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private async Task DataSeedAsync(IServiceProvider service)
|
||||
|
||||
Reference in New Issue
Block a user