Skip to content

Commit 8e19cf2

Browse files
committed
update demo
1 parent b2286fd commit 8e19cf2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Examples/aspnetcore_transaction/Startup.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ public void ConfigureServices(IServiceCollection services)
3636

3737
services.AddSingleton<IFreeSql>(Fsql);
3838
services.AddScoped<UnitOfWorkManager>();
39-
40-
//批量注入
41-
foreach (var repo in typeof(Startup).Assembly.GetTypes()
42-
.Where(a => a.IsAbstract == false && typeof(IBaseRepository).IsAssignableFrom(a)))
43-
services.AddScoped(repo);
39+
services.AddFreeRepository(null, typeof(Startup).Assembly);
40+
////批量注入
41+
//foreach (var repo in typeof(Startup).Assembly.GetTypes()
42+
// .Where(a => a.IsAbstract == false && typeof(IBaseRepository).IsAssignableFrom(a)))
43+
// services.AddScoped(repo);
4444
services.AddScoped<SongService>();
4545
}
4646

0 commit comments

Comments
 (0)