https://www.cnblogs.com/chenwolong/p/fanshe.html

    public static void ForeachClassProperties(T model)
    {
    Type t = model.GetType();
    PropertyInfo[] PropertyList = t.GetProperties();
    foreach (PropertyInfo item in PropertyList)
    {
    string name = item.Name;
    object value = item.GetValue(model, null);
    }
    }