string InsertString<T>(T t)
{
var type = typeof(T); //反射对象
var A = type.GetProperties(); //获取对象属性
var insertString = "insert into " + t.GetType().Name + " values ("; //t.GetType().Name 获取类名
foreach (var b in A) {
insertString += "@" + b.Name + ","; //遍历属性名
//b.GetValue(t); 获取对应值
}
insertString = insertString.TrimEnd(‘,‘) + ")";
return insertString;
}