StrongCX.Anlyzer
2.0.4
Suggested Alternatives
Additional Details
bugs: 无法在编译期生效
The owner has unlisted this package.
This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package StrongCX.Anlyzer --version 2.0.4
NuGet\Install-Package StrongCX.Anlyzer -Version 2.0.4
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="StrongCX.Anlyzer" Version="2.0.4"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="StrongCX.Anlyzer" Version="2.0.4" />
<PackageReference Include="StrongCX.Anlyzer"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add StrongCX.Anlyzer --version 2.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: StrongCX.Anlyzer, 2.0.4"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package StrongCX.Anlyzer@2.0.4
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=StrongCX.Anlyzer&version=2.0.4
#tool nuget:?package=StrongCX.Anlyzer&version=2.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
StrongCX.Anlyzer
OrnamentERPNew 的代码质量分析器
- BackupModelAnlyzer 备份表分析器
- ReadOnlyDatabaseAnalyzer 只读库分析器
- Attribute 自定义特性
BackupModelAnlyzer
备份表分析器,用于分析指定表的修改情况,若没有同步修改备份表,则抛出异常,并给出修补方式。
- 项目配置
<ItemGroup>
<AdditionalFiles Include="Analyzers/BackupModelAnlyzer.json" />
</ItemGroup>
- 项目文件
Analyzers/BackupModelAnlyzer.json
{
// 是否启用此分析器
"Enable": true,
"BackupTables": [
{
// 原始表名
"OriginalName": "dbo.Crm_ConsumerNetSignFile",
// 备份表名
"BackupName": "dbo.Crm_ConsumerNetSignFile_History",
// 开始分析的时间 202501131049021
"StartTime": 0
},
{
"OriginalName": "dbo.Mm_BillDetail",
"BackupName": "dbo.Mm_BillDetail_History",
"StartTime": 0
},
{
"OriginalName": "dbo.Mm_BillFile",
"BackupName": "dbo.Mm_BillFile_History",
"StartTime": 0
}
]
}
- 可以使用 IgnoreBackupModelAnlyzerAttribute 特性来忽略备份表分析器的检查。
namespace StrongCX.DataAccess.Migrations
{
using System;
using System.Data.Entity.Migrations;
[StrongCX.Anlyzers.Attributes.IgnoreBackupModelAnlyzer]
public partial class Update379 : DbMigration
{
public override void Up()
{
AddColumn("dbo.Sys_NoBackupTest", "CustomColumn", c => c.String());
AddColumn{|#0:("dbo.Sys_HasBackupTest", "CustomColumn", c => c.String())|};
}
public override void Down()
{
DropColumn("dbo.Sys_NoBackupTest", "CustomColumn");
DropColumn("dbo.Sys_HasBackupTest", "CustomColumn");
}
}
}
ReadOnlyDatabaseAnalyzer
只读数据库分析器,用于分析指定的只读数据库中是否添加特定SQL语句,没有添加则抛出异常,并给出修补方式。
- 项目配置
<ItemGroup>
<AdditionalFiles Include="Analyzers/ReadOnlyDatabaseAnalyzer.json" />
</ItemGroup>
- 项目文件
Analyzers/ReadOnlyDatabaseAnalyzer.json
{
// 是否启用此分析器
"Enable": true,
// 需要添加的语句
"ReadDbSQL": "Sql(ReadDBPublication.TransactionSQL);",
// 开始分析的时间 202501131049021
"StartTime": 0
}
- 可以使用 IgnoreReadOnlyDatabaseAnalyzerAttribute 特性来忽略只读数据库分析器的检查。
namespace StrongCX.DataAccess.Migrations
{
using System;
using System.Data.Entity.Migrations;
[StrongCX.Anlyzers.Attributes.IgnoreReadOnlyDatabaseAnalyzer]
public partial class Update379 : DbMigration
{
public override void Up()
{
// Sql(ReadDBPublication.TransactionSQL);
}
public override void Down()
{
}
}
}
Attribute
在项目中定义需要使用的特性
using System;
namespace StrongCX.Attributes
{
/// <summary>
/// 忽略备份表分析。
/// </summary>
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
public sealed class IgnoreBackupModelAnlyzerAttribute : Attribute { }
/// <summary>
/// 忽略只读库分析。
/// </summary>
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
public sealed class IgnoreReadOnlyDatabaseAnalyzerAttribute : Attribute { }
}
There are no supported framework assets in this package.
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|
1.可指定特性以忽略分析器的检查