| TypeName | ReadonlyFieldAnalyzer |
| Check Id | CC0052 |
| Category | Usage |
| Severity | Info |
A field that is only assigned when declared or in the constructor can be made reaonly. A readonly field cannot be assigned anywhere else after the object is created, making it immutable.
class Foo
{
private int i = 0;
}A code fix will be presented to you that will transform the code:
class Foo
{
private readonly int i = 0;
}
None
TBD