コード例 #1
0
 public static void DoSomething<TFoo>(this TFoo foo)     where TFoo : IFoo<IChild>
 {
     IFoo<IChild> bar = foo;
     //Added by Ashwani 
     ((IFoo<IChild>)foo).DoSomethingElse();//Will Complie
     foo.DoSomethingElseTotally(); //Will Complie
     
     //foo.DoSomethingElse();	// Doesn't compile -- why not?
     bar.DoSomethingElse();		// OK
     DoSomethingElse(foo);		// Also OK!
     
 }