Tedd.ReadOnlyStructGenerator
1.0.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Tedd.ReadOnlyStructGenerator --version 1.0.1
NuGet\Install-Package Tedd.ReadOnlyStructGenerator -Version 1.0.1
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="Tedd.ReadOnlyStructGenerator" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Tedd.ReadOnlyStructGenerator --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Tedd.ReadOnlyStructGenerator, 1.0.1"
#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 Tedd.ReadOnlyStructGenerator as a Cake Addin #addin nuget:?package=Tedd.ReadOnlyStructGenerator&version=1.0.1 // Install Tedd.ReadOnlyStructGenerator as a Cake Tool #tool nuget:?package=Tedd.ReadOnlyStructGenerator&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Tedd.ReadOnlyStructGenerator
.NET Source Generator for duplicating structs to read-only copies.
Adding [GenerateReadOnlyStruct] to a struct like this
[GenerateReadOnlyStruct]
public struct Test
{
public float X;
public float Y;
public float Z;
}
will inject this code into your project
public readonly struct ReadOnlyTest
{
public readonly float X;
public readonly float Y;
public readonly float Z;
public ReadOnlyTest(Test value)
{
X = value.X;
Y = value.Y;
Z = value.Z;
}
public ReadOnlyTest(float x, float y, float z)
{
this.X = x;
this.Y = y;
this.Z = z;
}
}
There are no supported framework assets in this package.
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- 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.
Now using IIncrementalGenerator for less overhead