From 8e19cf23a24a91a135b1db7be5289703c0611a72 Mon Sep 17 00:00:00 2001 From: 2881099 <2881099@qq.com> Date: Thu, 9 Mar 2023 19:44:54 +0800 Subject: [PATCH] update demo --- Examples/aspnetcore_transaction/Startup.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Examples/aspnetcore_transaction/Startup.cs b/Examples/aspnetcore_transaction/Startup.cs index 9744693e..ad8b68a2 100644 --- a/Examples/aspnetcore_transaction/Startup.cs +++ b/Examples/aspnetcore_transaction/Startup.cs @@ -36,11 +36,11 @@ namespace aspnetcore_transaction services.AddSingleton(Fsql); services.AddScoped(); - - //批量注入 - foreach (var repo in typeof(Startup).Assembly.GetTypes() - .Where(a => a.IsAbstract == false && typeof(IBaseRepository).IsAssignableFrom(a))) - services.AddScoped(repo); + services.AddFreeRepository(null, typeof(Startup).Assembly); + ////批量注入 + //foreach (var repo in typeof(Startup).Assembly.GetTypes() + // .Where(a => a.IsAbstract == false && typeof(IBaseRepository).IsAssignableFrom(a))) + // services.AddScoped(repo); services.AddScoped(); }