Set all attribute values at one time, of course, ensure that the attributes are of the same type

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

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324971747&siteId=291194637