Skip to content

Commit 91bc3d0

Browse files
authored
Merge pull request #25631 from abpframework/auto-merge/rel-10-5/4655
Merge branch dev with rel-10.5
2 parents 0ada7b9 + 7b27b4a commit 91bc3d0

1 file changed

Lines changed: 18 additions & 9 deletions

File tree

modules/identityserver/test/Volo.Abp.IdentityServer.TestBase/Volo/Abp/IdentityServer/AbpIdentityServerTestBaseModule.cs

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
using Microsoft.Extensions.DependencyInjection;
2-
using Volo.Abp.Autofac;
3-
using Volo.Abp.Modularity;
4-
using Volo.Abp.Threading;
5-
1+
using Microsoft.Extensions.DependencyInjection;
2+
using Volo.Abp.Autofac;
3+
using Volo.Abp.Modularity;
4+
using Volo.Abp.Threading;
5+
using Volo.Abp.Uow;
6+
67
namespace Volo.Abp.IdentityServer;
78

89
[DependsOn(
@@ -38,9 +39,17 @@ private static void SeedTestData(ApplicationInitializationContext context)
3839
{
3940
using (var scope = context.ServiceProvider.CreateScope())
4041
{
41-
AsyncHelper.RunSync(() => scope.ServiceProvider
42-
.GetRequiredService<AbpIdentityServerTestDataBuilder>()
43-
.BuildAsync());
42+
AsyncHelper.RunSync(async () =>
43+
{
44+
var unitOfWorkManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>();
45+
using (var uow = unitOfWorkManager.Begin(requiresNew: true))
46+
{
47+
await scope.ServiceProvider
48+
.GetRequiredService<AbpIdentityServerTestDataBuilder>()
49+
.BuildAsync();
50+
await uow.CompleteAsync();
51+
}
52+
});
4453
}
4554
}
46-
}
55+
}

0 commit comments

Comments
 (0)