const
A C# field whose value is fixed at compile time and can never change, such as public const string SectionName = "Catalog".
In more detail
The compiler copies a const value into every place that uses it. Using a named constant instead of repeating a string literal means a typo becomes a compile error.
Related terms
- readonly — A modifier, in languages such as C# and TypeScript, that lets a field or property be assigned only when it is initialised, never afterwards.
Taught in
- The Options Pattern: Strongly Typed Configuration — Modern .NET Core, C# & Enterprise Microservices