IdGen.DependencyInjection
3.0.7
dotnet add package IdGen.DependencyInjection --version 3.0.7
NuGet\Install-Package IdGen.DependencyInjection -Version 3.0.7
<PackageReference Include="IdGen.DependencyInjection" Version="3.0.7" />
<PackageVersion Include="IdGen.DependencyInjection" Version="3.0.7" />
<PackageReference Include="IdGen.DependencyInjection" />
paket add IdGen.DependencyInjection --version 3.0.7
#r "nuget: IdGen.DependencyInjection, 3.0.7"
#:package IdGen.DependencyInjection@3.0.7
#addin nuget:?package=IdGen.DependencyInjection&version=3.0.7
#tool nuget:?package=IdGen.DependencyInjection&version=3.0.7
Dependency injection support for IdGen
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- IdGen (>= 3.0.7)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Options (>= 8.0.2)
NuGet packages (10)
Showing the top 5 NuGet packages that depend on IdGen.DependencyInjection:
| Package | Downloads |
|---|---|
|
DataExplorer
Library featuring an opinionated, reusable data access layer offering abstractions and implementations for SQL storages (EF Core). |
|
|
HZY.Framework.Repository.EntityFramework
HZY.Framework EF Core 仓储:泛型仓储、软删除、审计字段、雪花 ID、分表、字段加密、事务、批量操作 ===== 使用教程 ===== 1、安装 Provider 包(SqlServer/MySql/PostgreSql/Oracle/Sqlite)并注册: builder.AddMySqlRepository<AppDbContext>(new RepositoryOptions { ConnectionString = "server=...;database=..." }); var app = builder.Build(); app.UseRepository(); 2、实体标记特性即生效: [TableId] → 主键自动雪花 ID(UuId/UuIdString 可选) [TableLogic] → 软删除:查询自动过滤,删除改写为 UPDATE [TableField(TableFieldFill.CreateTime)] → 审计自动填充 (CreateTime/CreateId/UpdateTime/UpdateId/ DeleteTime/DeleteId) 3、IRepository<T> 全部函数(同步/异步成对,Async 略)。 注入:public class MemberService(IRepository<Member> repo) ▎查询 repo.Select // 跟踪 IQueryable(链式 LINQ 起点) repo.SelectNoTracking // 免跟踪查询 repo.Find(w => w.Name == "hz") // 按表达式查单条 repo.FindById(1L) // 按主键查单条 repo.ToList(w => w.Age > 18) // 按表达式查列表 repo.ToListAll() // 全表 repo.GetAllListByCache(20) // 全表内存缓存(分钟) repo.Count() / repo.Any(w => ...) // 计数/存在 repo.QueryableBySql(sql, params) // 原生 SQL 转 IQueryable 继续链式 repo.QueryBySql(sql) / QueryDicBySql(sql) / QueryDataTableBySql(sql) repo.QuerySingleBySql<long>("SELECT COUNT(1) FROM member") repo.FillFieldsToDict(list) // 补全字典文本(配合 [Dict]) ▎插入(雪花 ID、审计字段自动填充) var member = repo.Insert(new Member { Name = "hz" }); repo.InsertRange(list); repo.InsertBatch(list); // 分块批量(按库参数上限拆分) ▎修改 repo.Update(member); // 整实体更新 repo.Update(member, "IgnoreField");// 忽略指定字段 repo.Update(old, updated); // 只更新差异字段 repo.UpdateRange(list); // 批量(另有 UpdateRangeById) repo.UpdateBulk(s => s.SetProperty(w => w.Age, 20), // update set where w => w.Name == "hz"); repo.UpdateBatch(list); // 分块批量 ▎插入或修改(按主键有无自动分流) repo.InsertOrUpdate(member); repo.InsertOrUpdateRange(list) / InsertOrUpdateBatch(list) ▎删除(含 [TableLogic] 时自动转软删除 UPDATE) repo.Delete(member); // 删除实体 repo.Delete(w => w.Age > 99); // 按表达式 repo.DeleteById(1L); // 按主键(另有 DeleteByIds) repo.DeleteBulk(w => w.Age > 99); // 直接 delete from where ▎原生 SQL 写入 repo.ExecuteSqlRaw("UPDATE member SET age={0} WHERE id={1}", 20, 1L); ▎批量原生 SQL(Provider 包启用,1 条 SQL 处理 N 行) repo.BulkInsertRange(list) / BulkUpdateRange(list) repo.BulkInsertOrUpdateRange(list) ▎IQueryable 扩展 repo.Select.WhereIf(cond, w => ...) // 条件成立才过滤 .ToPage(page, size) // 分页(另有 ToPageIf) ▎基础 repo.UnitOfWork // 工作单元(延迟提交) repo.GetContext() // 取 DbContext 4、字典映射(编码自动翻译为文本): [Dict("sys_dict", "code", "text", ToField = "GenderText")] public string? Gender { get; set; } // 存编码 M/F public string? GenderText { get; set; } // 查询后自动填 男/女 5、事务(AOP,支持嵌套、多库): [Transactional] public async Task CreateOrderAsync(Order order) { } [Transactional(typeof(AppDbContext), typeof(ErpDbContext))] public async Task SyncErpAsync(Order order) { } 6、SQL 监控:optionsBuilder.AddEntityFrameworkMonitor(isMonitor: true) 源码与完整文档:https://gitee.com/hzy6/HZY.Framework 实战案例(HzyAdmin):https://gitee.com/hzy6/HzyAdmin |
|
|
Miki.Common
Package Description |
|
|
Mook.Admin.Core
Admin.Core |
|
|
cloops.microservices
Opinionated SDK to effortlessly build lean highly performant cloud native microservices |
GitHub repositories (2)
Showing the top 2 popular GitHub repositories that depend on IdGen.DependencyInjection:
| Repository | Stars |
|---|---|
|
LeonKou/NetPro
🌈An enhanced version with clean architecture of asp.netcore,efficiently manage startup,Support for netcore3.1/6.0
|
|
|
hzy-6/hzy-admin
前后端分离权限管理系统基架! 数据权限、按钮权限、动态菜单、动态任务调度、动态WebApi、定时标记 [Scheduled("0/5 * * * * ?")] 、代码生成
|
Initial release