In C# if you’re referencing property, class or namespace names in your code use the nameof() expression rather than strings so your references are type safe…
If you have string literals containing property, class and namespace names all around your code you have to maintain them manually. If you rename a class which is referenced from a string you have to remember to change the value of the string too but if you use nameof() this is done automatically by your IDE.
Need Help with Your C# Projects?
We offer expert support and development services for projects of any size. Contact us for a free consultation and see how we can help you succeed.
CONTACT US NOW