2

私のメソッド定義は

public ActionResult _Create3<T>() where T:IMyClass, new()

しかし、私は2つのジェネリック型を定義したい

public ActionResult _Create3<T, G>(G content) where T:IMyClass, new()

タイプ G もインターフェイス ImyClass を使用する必要がありますが、どこで tow タイプを定義するかわかりません!!!

たとえば、次のように書くことができます:

public ActionResult _Create3<T, G>(G content) where {T:IMyClass, G:IMyClass}, new()

しかし、エラーが発生します。

ご回答ありがとうございます

4

2 に答える 2