I have the following readonly string in my C# class.
private readonly string someString= "I am a string.";
I feel the urge to convert this to a const
because the information is available at compile time. However, I have it as readonly
because I am using it in a non-static context.
Is this the right thing to do? Or am I having an issue with my code design?
const
in a non-static context is wrong?const
is enough. Evenconst
can be used in non-static context.