mirror of
https://github.com/dotnetcore/FreeSql.git
synced 2026-02-15 12:50:55 +08:00
update
@@ -193,14 +193,9 @@ public void ConfigureServices(IServiceCollection services)
|
|||||||
services.AddSingleton<IFreeSql>(fsql);
|
services.AddSingleton<IFreeSql>(fsql);
|
||||||
services.AddScoped<FreeSql.IUnitOfWork>(sp => fsql.CreateUnitOfWork());
|
services.AddScoped<FreeSql.IUnitOfWork>(sp => fsql.CreateUnitOfWork());
|
||||||
|
|
||||||
services.AddScoped(typeof(IReadOnlyRepository<>), typeof(UnitOfWorkRepository<>));
|
services.AddScoped(typeof(IBaseRepository<>), typeof(UnitOfWorkRepository<>));
|
||||||
services.AddScoped(typeof(IBasicRepository<>), typeof(UnitOfWorkRepository<>));
|
|
||||||
services.AddScoped(typeof(BaseRepository<>), typeof(UnitOfWorkRepository<>));
|
services.AddScoped(typeof(BaseRepository<>), typeof(UnitOfWorkRepository<>));
|
||||||
|
|
||||||
services.AddScoped(typeof(IReadOnlyRepository<,>), typeof(UnitOfWorkRepository<,>));
|
|
||||||
services.AddScoped(typeof(IBasicRepository<,>), typeof(UnitOfWorkRepository<,>));
|
|
||||||
services.AddScoped(typeof(BaseRepository<,>), typeof(UnitOfWorkRepository<,>));
|
|
||||||
|
|
||||||
//批量注入程序集内的所有自建仓储类,可以根据自己需要来修改
|
//批量注入程序集内的所有自建仓储类,可以根据自己需要来修改
|
||||||
Assembly[] assemblies = new [] { typeof(XxxRepository).Assembly };
|
Assembly[] assemblies = new [] { typeof(XxxRepository).Assembly };
|
||||||
if (assemblies?.Any() == true)
|
if (assemblies?.Any() == true)
|
||||||
|
|||||||
7
事务.md
7
事务.md
@@ -99,14 +99,9 @@ public void ConfigureServices(IServiceCollection services)
|
|||||||
services.AddSingleton<IFreeSql>(fsql);
|
services.AddSingleton<IFreeSql>(fsql);
|
||||||
services.AddScoped<FreeSql.IUnitOfWork>(sp => fsql.CreateUnitOfWork());
|
services.AddScoped<FreeSql.IUnitOfWork>(sp => fsql.CreateUnitOfWork());
|
||||||
|
|
||||||
services.AddScoped(typeof(IReadOnlyRepository<>), typeof(UnitOfWorkRepository<>));
|
services.AddScoped(typeof(IBaseRepository<>), typeof(UnitOfWorkRepository<>));
|
||||||
services.AddScoped(typeof(IBasicRepository<>), typeof(UnitOfWorkRepository<>));
|
|
||||||
services.AddScoped(typeof(BaseRepository<>), typeof(UnitOfWorkRepository<>));
|
services.AddScoped(typeof(BaseRepository<>), typeof(UnitOfWorkRepository<>));
|
||||||
|
|
||||||
services.AddScoped(typeof(IReadOnlyRepository<,>), typeof(UnitOfWorkRepository<,>));
|
|
||||||
services.AddScoped(typeof(IBasicRepository<,>), typeof(UnitOfWorkRepository<,>));
|
|
||||||
services.AddScoped(typeof(BaseRepository<,>), typeof(UnitOfWorkRepository<,>));
|
|
||||||
|
|
||||||
//批量注入程序集内的所有自建仓储类,可以根据自己需要来修改
|
//批量注入程序集内的所有自建仓储类,可以根据自己需要来修改
|
||||||
Assembly[] assemblies = new [] { typeof(XxxRepository).Assembly };
|
Assembly[] assemblies = new [] { typeof(XxxRepository).Assembly };
|
||||||
if (assemblies?.Any() == true)
|
if (assemblies?.Any() == true)
|
||||||
|
|||||||
6
工作单元.md
6
工作单元.md
@@ -43,12 +43,8 @@ public void ConfigureServices(IServiceCollection services)
|
|||||||
services.AddSingleton<IFreeSql>(fsql);
|
services.AddSingleton<IFreeSql>(fsql);
|
||||||
services.AddScoped<FreeSql.IUnitOfWork>(sp => fsql.CreateUnitOfWork());
|
services.AddScoped<FreeSql.IUnitOfWork>(sp => fsql.CreateUnitOfWork());
|
||||||
|
|
||||||
services.AddScoped(typeof(IReadOnlyRepository<>), typeof(UnitOfWorkRepository<>));
|
services.AddScoped(typeof(IBaseRepository<>), typeof(UnitOfWorkRepository<>));
|
||||||
services.AddScoped(typeof(IBasicRepository<>), typeof(UnitOfWorkRepository<>));
|
|
||||||
services.AddScoped(typeof(BaseRepository<>), typeof(UnitOfWorkRepository<>));
|
services.AddScoped(typeof(BaseRepository<>), typeof(UnitOfWorkRepository<>));
|
||||||
services.AddScoped(typeof(IReadOnlyRepository<,>), typeof(UnitOfWorkRepository<,>));
|
|
||||||
services.AddScoped(typeof(IBasicRepository<,>), typeof(UnitOfWorkRepository<,>));
|
|
||||||
services.AddScoped(typeof(BaseRepository<,>), typeof(UnitOfWorkRepository<,>));
|
|
||||||
|
|
||||||
//批量注入程序集内的所有自建仓储类,可以根据自己需要来修改
|
//批量注入程序集内的所有自建仓储类,可以根据自己需要来修改
|
||||||
Assembly[] assemblies = new [] { typeof(XxxRepository).Assembly };
|
Assembly[] assemblies = new [] { typeof(XxxRepository).Assembly };
|
||||||
|
|||||||
Reference in New Issue
Block a user