・IHoge.cs
interface IHoge { void Bar (); T Fuga (); // <- だめ }
これだとTの返り値が怒られる。object
「c# interface method generic return type」にて検索すると、
URL: http://stackoverflow.com/questions/10147292/c-sharp-interface-specfying-a-generic-return-type
の解答がまさにそれ!
interface IHoge<T> // <- Tをつける { void Bar (); T Fuga (); }
IHogeのインターフェイス名の右横に
ちなみに、
interface IHoge // <- Tを外す { void Bar (); T Fuga <T>(); // <- 型パラメータ付き }