次のようなものが機能します。
public T Get<T>(int id)
{
var newTypeName = typeof(T).FullName + "Data";
var newType = Type.GetType(newTypeName);
var argTypes = new [] { newType };
var method = GetType().GetMethod("Get");
var typedMethod = method.MakeGenericMethod(argTypes);
return (T) typedMethod.Invoke(this, new object[] { id });
}
XxxData オブジェクトが Xxx から継承されていない場合は、結果を返す前に自動マッピングを実行する必要があります。
次に、最後の行を次のように置き換える必要があります。
var dataResult = typedMethod.Invoke(this, new object[] { id });
var result = new T(); // You will have to add a new() constraint on generic parameter
// Map your dataResult object's values onto the result object's values
return result;