最終的な式のために 2 つの式を連結したい
Expression<Func<T, string>>
だから私は式の下のコードを作成した
タイプ 'System.Int32' の式は、メソッド 'System.String Concat(System.String, System.String)' のタイプ 'System.String' のパラメータには使用できません
式を次のように変換すると
var conversion = Expression.Convert(memberExpression, typeof (string));
型 'System.Int32' と 'System.String' の間に強制演算子が定義されていません。
解決するのを手伝ってください
コード
MethodInfo bodyContactMethod = typeof (string).GetMethod("Concat",new[] {typeof (string), typeof (string)});
ParameterExpression parameter = Expression.Parameter(typeof (T));
body = Expression.Call(bodyContactMethod, cons, memberExpression);
return Expression.Lambda<Func<T, string>>(body, parameter);