I have a WCF WebService that generates partial classes. Therefore I cannot put DebuggerDisplayAttribute
on any of them, because it would be overriden at each update of the web service reference.
Can I have partial classes that define the DebuggerDisplayAttribute
for some properties, just like for instance we can use MetadataType
for view display in MVC?
You are correct that changing the generated DataContract is a waste of time.
Luckily the classes are
partial
so you can have a second class file that holds logic that you need but doesn't get generated. You can annotate that partial class with the Debugger hints. For your scenario you'll need a DebuggerTypeProxy that holds a type you created to be instantiated by the debugger instead of the instance of your real class: