Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 925 Bytes

SA1214.md

File metadata and controls

39 lines (29 loc) · 925 Bytes

SA1214

TypeName SA1214ReadonlyElementsMustAppearBeforeNonReadonlyElements
CheckId SA1214
Category Ordering Rules

Cause

A readonly field is positioned beneath a non-readonly field.

Rule description

A violation of this rule occurs when a readonly field is positioned beneath a non-readonly field.

How to fix violations

To fix an instance of this violation, place all readonly fields above all non-readonly fields.

How to suppress violations

[SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1214:ReadonlyElementsMustAppearBeforeNonReadonlyElements", Justification = "Reviewed.")]
#pragma warning disable SA1214 // ReadonlyElementsMustAppearBeforeNonReadonlyElements
#pragma warning restore SA1214 // ReadonlyElementsMustAppearBeforeNonReadonlyElements