更新时间:2023-11-07 19:13:34
您可以尝试转换为对象,然后调用 ToString(),而不是尝试转换为字符串:
Instead of trying to cast to string, you could try casting to object then calling ToString(), as though you were doing:
var converted = member.ToString();
作为一个表达式,它看起来像这样:
As an Expression, it will look something like this:
var convertedExpression = Expression.Call(
Expression.Convert(memberExpression, typeof(object)),
typeof(object).GetMethod("ToString"));