Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Lu Ban Of .Net - .NET 工匠辅助库。Net 高可用、高效率的扩展库,希望对 .NET 开发者及爱好者带来便捷,告别996,远离ICU!!!

License

NotificationsYou must be signed in to change notification settings

CacoCode-zz/LBON

Repository files navigation

Github Build StatusnugetdownloadsLicense

中文|English

Lu Ban Of .Net - .NET 鲁班工匠辅助库

.Net 高可用、高效率的扩展库,希望对 .NET 开发者及爱好者带来便捷,告别996,远离ICU!!!

Nuget

名称Nuget
LBON.ConstsNuGet
LBON.ExtensionsNuGet
LBON.HelperNuGet
LBON.DependencyInjectionNuGet
LBON.EntityFrameworkCoreNuGet

功能模块

LBON.EntityFrameworkCore

EntityFramework 底层实现和扩展类,包括创建审计字段、修改审计字段、删除审计字段和扩展字段的封装

publicclassFullAuditedEntity<TKey,TUser>:EntityBase<TKey>,ICreationAudited<TUser>,IModificationAudited<TUser>,IDeletionAudited<TUser>{publicTUserCreatorId{get;set;}publicDateTimeCreationTime{get;set;}publicTUserLastModifierId{get;set;}publicDateTime?LastModificationTime{get;set;}publicTUserDeleterId{get;set;}publicboolIsDeleted{get;set;}publicDateTime?DeletionTime{get;set;}}

另外还添加ExtendableObjectExtensions扩展类去设置(SetData)、获取(GetData) ExtendableObject字段的值。封装IEfRepository,满足绝大部分EF操作

IQueryable<TEntity>GetAll(paramsExpression<Func<TEntity,object>>[]propertySelectors);IQueryable<TEntity>GetAll(Expression<Func<TEntity,bool>>expression,paramsExpression<Func<TEntity,object>>[]propertySelectors);TEntityFind(TPrimaryKeyid);Task<TEntity>FindAsync(TPrimaryKeyid);TEntityGet(Expression<Func<TEntity,bool>>expression,paramsExpression<Func<TEntity,object>>[]propertySelectors);Task<TEntity>GetAsync(Expression<Func<TEntity,bool>>expression,paramsExpression<Func<TEntity,object>>[]propertySelectors);voidInsert(TEntityentity,boolautoSave=true);TaskInsertAsync(TEntityentity,boolautoSave=true);Task<TPrimaryKey>InsertAndGetIdAsync(TEntityentity,boolautoSave=true);voidInsertList(List<TEntity>entities,boolautoSave=true);TaskInsertListAsync(List<TEntity>entities,boolautoSave=true);voidUpdate(TEntityentity,boolautoSave=true);TaskUpdateAsync(TEntityentity,boolautoSave=true);voidUpdateList(IEnumerable<TEntity>entities);TaskUpdateListAsync(IEnumerable<TEntity>entities);voidDelete(TPrimaryKeyid,boolautoSave=true);TaskDeleteAsync(TPrimaryKeyid,boolautoSave=true);voidDelete(TEntityentity,boolautoSave=true);TaskDeleteAsync(TEntityentity,boolautoSave=true);voidHardDelete(TPrimaryKeyid,boolautoSave=true);TaskHardDeleteAsync(TPrimaryKeyid,boolautoSave=true);voidHardDelete(TEntityentity,boolautoSave=true);TaskHardDeleteAsync(TEntityentity,boolautoSave=true);

在.NET CORE 中使用的话,可以引入LBON.EntityFrameworkCore库,里面封装了对IEfRepository的以来注入,并且实现了对IScopedDependency、ISingletonDependency、ITransientDependency继承类的自动批量注入,方便使用者注入自身服务。

publicvoidConfigureServices(IServiceCollectionservices){services.ServiceRegister(Assembly.Load("AssemblyName"),Assembly.Load("AssemblyName"));}
// ScopedpublicinterfaceIProductService:IScopedDependency{}// SingletonpublicinterfaceIProductService:ISingletonDependency{}// TransientpublicinterfaceIProductService:ITransientDependency{}

LBON.Extensions

LBON.Helper

LBON.Consts

About

Lu Ban Of .Net - .NET 工匠辅助库。Net 高可用、高效率的扩展库,希望对 .NET 开发者及爱好者带来便捷,告别996,远离ICU!!!

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp