一次性设置设置所有属性值,当然要保证属性的类型相同

foreach (PropertyInfo propertyInfo in base.GetType().GetProperties())
             {
                 if (propertyInfo.CanWrite)
                 {
                     propertyInfo.SetValue(this, tag, null);
                 }
             }

原文地址:https://www.cnblogs.com/atuo/p/8963046.html