C#C
C#3y ago
GNUGradyn

❔ Appease "Property is uninitialized" without setting a default value? Possibly make it required?

Hello, I am trying to go through my code and fix all the warnings to improve code quality. I have this string property that must be set when this class is instantiated. It does not have a default value because it must be set every time when you create an instance of this class. Because of this I get this warning. Is there an annotation or something to tell the compiler "this property is required, and so this class cannot be instantiated without it" to appease the warning?
image.png
Was this page helpful?