Overload resolution is performed at compile time. The compiler knows nothing about T , so the only applicable overload is:
public static string ID(this object item) { return "Unknown"; }
If you want to efficiently handle overload resolution at run time, and if you use C # 4, you may need to use dynamic - which, unfortunately, does not support extension methods directly:
public static string GetID(dynamic item) { return Extensions.ID(item); }
source share