ObjectPortrayal Method
Definition
ObjectPortrayal(object, Action<ObjectPortrayalOptions>)
Generates a portrayal of the specified instance that might contain information about the instance state.
public static string ObjectPortrayal(object instance, Action<ObjectPortrayalOptions> setup = null)
Parameters
instanceobjectThe instance of an Object to convert.
setupAction<ObjectPortrayalOptions>The ObjectPortrayalOptions which may be configured.
Returns
Remarks
When determining the representation of the specified instance, these default rules applies:
1: if the ToString() method has been overridden, any further processing is skipped (the assumption is, that a custom representation is already in place)
2: any public properties having index parameters is skipped
3: any public properties is appended to the result if ToString() has not been overridden
Note: do not call this method from an overridden ToString(..) method without setting BypassOverrideCheck to true; otherwise a StackOverflowException will occur.