Skip to content

vipwan/Biwen.AutoClassGen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Biwen.AutoClassGen

Nuget Nuget GitHub license PRs Welcome

Usage scenario

  • In many cases, we will have a lot of request objects, such as GetIdRequest, GetUserRequest, etc..., and these requests may have a large number of the same fields. For example, the multi-tenant Id, the number of pages, and these attribute fields may have validation rules, binding rules, and Swagger descriptions. If all this code needs to be written, it will add a lot of work, so Biwen.AutoClassGen came into being to solve this pain point...
  • In many cases, we will have a lot of DTO objects,
  • AOP & Decorator
  • Auto Inject
  • Version Info

中文

Usage

<ItemGroup>
	<PackageReference Include="Biwen.AutoClassGen.Attributes" Version="x.x.x" />
	<PackageReference Include="Biwen.AutoClassGen" Version="x.x.x" PrivateAssets="All" />
</ItemGroup>

Code Generators

Code Analyzers

  • GEN001 : 标注接口没有继承基础接口因此不能生成类
  • GEN011 : 生成类的类名称不可和接口名重名
  • GEN021 : 推荐使用相同的命名空间
  • GEN031 : 使用[AutoGen]自动生成
  • GEN041 : 重复标注[AutoDto]
  • GEN042 : 不可在abstract类上标注[AutoDto]
  • GEN043 : 标记为[AutoDecor]的类必须是public
  • GEN044 : [AutoDto]引用了外部类是不允许的
  • GEN045 : [AutoDto]标注的类必须是partial类
  • GEN050 : 文件缺少头部信息
  • GEN051 : 异步方法应该以Async结尾
  • GEN052 : 建议使用文件范围命名空间
  • GEN053 : 源代码非UTF-8编码

Code Fixs

  • 移除无效的[AutoDto]标注
  • 使用[AutoGen]自动生成
  • 推荐使用相同的命名空间
  • 文件缺少头部信息
  • 异步方法应该以Async结尾
  • .etc

Used by

if you use this library, please tell me, I will add your project here.