我有这个代码循环一个对象,并通过反射获取其所有属性:
foreach (var propertyInfo in typeof(TBase).GetProperties(BindingFlags.Public | BindingFlags.Instance))
{
var oldValue = propertyInfo.GetValue(oldVersion, null);
}
Run Code Online (Sandbox Code Playgroud)
如何检查只查看其上有"设置"的属性?(我想忽略只读值 - 只是"获取".)