RandomAnalyzers.RequiredMember.Analyzer
0.1.0
See the version list below for details.
dotnet add package RandomAnalyzers.RequiredMember.Analyzer --version 0.1.0
NuGet\Install-Package RandomAnalyzers.RequiredMember.Analyzer -Version 0.1.0
<PackageReference Include="RandomAnalyzers.RequiredMember.Analyzer" Version="0.1.0" />
paket add RandomAnalyzers.RequiredMember.Analyzer --version 0.1.0
#r "nuget: RandomAnalyzers.RequiredMember.Analyzer, 0.1.0"
// Install RandomAnalyzers.RequiredMember.Analyzer as a Cake Addin #addin nuget:?package=RandomAnalyzers.RequiredMember.Analyzer&version=0.1.0 // Install RandomAnalyzers.RequiredMember.Analyzer as a Cake Tool #tool nuget:?package=RandomAnalyzers.RequiredMember.Analyzer&version=0.1.0
Installation
RequiredMember can be installed using the NuGet command line or the NuGet Package Manager in Visual Studio.
Install using the command line:
Install-Package RandomAnalyzers.RequiredMember
Description
RequiredMember library provides you new attribute called RequiredMemberAttribute
. All members of the class/struct that are marked with this attribute will require to be initialized inside object initializer. Otherwise the RequiredMember.Analyzer
will sygnalize a warning that members were not initialized and you are required to do so.
Code
using RandomAnalyzers.RequiredMember;
public class Test
{
[RequiredMember]
public int property { get; set; }
}
// no warnings/errors
var variable = new Test()
{
property = 123
};
// warning
var variable = new Test();
var variable = new Test() {};
UI Example
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on RandomAnalyzers.RequiredMember.Analyzer:
Package | Downloads |
---|---|
RandomAnalyzers.RequiredMember
Provides RequiredMemberAttribute used to mark members of given classes/structs as required members. Members annotated with this attribute will be required inside object initializer. |
GitHub repositories
This package is not used by any popular GitHub repositories.
0.1.0:
Test upload