sbTemp.AppendFormat(" public Model_{0} GetModel(Model_{1} model)\r\n}", tableName, tableName);将字符串最后的 }去掉改为:即可 sbTemp.AppendFormat(" public Model_{0} GetModel(Model_{1} model)\r\n", tableName, tableName);