コンストラクタは次のとおりです。
public PartyRoleRelationship(PartyRole firstRole, PartyRole secondRole)
{
if (firstRole == secondRole)
throw new Exception("PartyRoleRelationship cannot relate a single role to itself.");
if (firstRole.OccupiedBy == null || secondRole.OccupiedBy == null)
throw new Exception("One or both of the PartyRole parameters is not occupied by a party.");
// Connect this relationship with the two roles.
_FirstRole = firstRole;
_SecondRole = secondRole;
T = _FirstRole.GetType().MakeGenericType();
_SecondRole.ProvisionRelationship<T>(_FirstRole); // Connect second role to this relationship.
}
_SecondRole で ProvisionRelationship を呼び出す最後の行で、実行時エラーが発生します: Type or namespace 'T' could not be found...
(a) T を適切に割り当てるか、(b) コンストラクターでジェネリック型を渡すにはどうすればよいですか? かなりの数の投稿に目を通しましたが、理解不足のために何かを見落としている可能性があります。これに関する誰の助けも大歓迎です。