I have a piece of code in my program that distinguishes compiler-generated classes by checking whether they contain “DisplayClass” in its type name.
upon reading this answer, I think I need a better way. How to distingush compiler-generated classes from user classes in .NET?
I have a piece of code in my program that distinguishes compiler-generated classes by
Share
Check classes for attribute
CompilerGeneratedto distinguish compiler generated classes from otherhttp://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.compilergeneratedattribute.aspx
In reflector those Display classes can be seen like this: