Possible Duplicate:
How to determine if the MethodInfo is an override of the base method
Normally, when we execute “ToString” method of any complex type it will return current type name like the following string except there is “ToString” overrided method.
System.Data.Entity.DynamicProxies.UserRole_D77A004638495805D68478322DF47F48540438D82DC9A5A0E1B0B2A181E4A100
I want some logic to detect current type about this because I try to export data to excel format. But some property of model is complex type that doesn’t define “ToString” method. Output of this property is useless for normal user.

Thanks,
I think this approach to check whether particular type overrides ToString or not is a little bit brittle. We can solve this in several other ways.
First of all if string representation is required you can add additional mixin interface like IObjectDescriptor with one method: string GetDescription. And you can require this implentation from every type (and if class is not implements it throw an exception).
Second approach (if we don’t want to change existing code base) is use separate helper class that will have one method: ConvertToString:
In both cases your intention and “contract” between you and your clients would be much more clear. In first case you’ll throw an exception if type is not implements particular interface, with second approach you’ll get at least consistent behavior.