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(); }