Fody
This is an add-in forCreates immutable types
The nuget package
https://nuget.org/packages/Immutable.Fody/
PM> Install-Package Immutable.Fody
Your code
[Immutable]
public class Sample
{
public string MyField = "Foo";
}
What gets compiled
public class Sample
{
public readonly string MyField = "Foo";
}
What fields are targeted
- For Types with the
[Immutable]
attribute. - All instance fields
Icon
Icon courtesy of The Noun Project