RandomAnalyzers.RequiredMember.Analyzer 1.0.0

dotnet add package RandomAnalyzers.RequiredMember.Analyzer --version 1.0.0                
NuGet\Install-Package RandomAnalyzers.RequiredMember.Analyzer -Version 1.0.0                
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="RandomAnalyzers.RequiredMember.Analyzer" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RandomAnalyzers.RequiredMember.Analyzer --version 1.0.0                
#r "nuget: RandomAnalyzers.RequiredMember.Analyzer, 1.0.0"                
#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.
// Install RandomAnalyzers.RequiredMember.Analyzer as a Cake Addin
#addin nuget:?package=RandomAnalyzers.RequiredMember.Analyzer&version=1.0.0

// Install RandomAnalyzers.RequiredMember.Analyzer as a Cake Tool
#tool nuget:?package=RandomAnalyzers.RequiredMember.Analyzer&version=1.0.0                

NuGet

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

Screenshot showing warnings for RequiredMember.Analyzer

There are no supported framework assets in this package.

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.

Version Downloads Last updated
1.0.0 13,748 10/30/2019
1.0.0-rc1 460 10/30/2019
0.1.0 625 10/29/2019

1.0.0:
Initial release

0.1.0:

Test upload