我有这个:
IEnumerable<dynamic> operations;
foreach(var row in operations)
{
// this works, myElementName is a db field
var tmp = row.myElementName;
// this is what I wish:
string myField ="myElementName";
var tmp_error = row.getProperty(myField);
}
有可能吗?我尝试过反射,但它没有用。
not work'因为getProperty不存在并且使用反射检索空值
谢谢!