/// <summary> /// 根据实例主键进行更新 /// </summary> public static bool Update <T>(T t) where T : OrmBaseModel { if (null == t) { throw new ArgumentNullException("instance can't be null"); } var parameters = SqlCache <T> .GetUpdateMySqlParameters(t); var sqlStr = SqlCache <T> .GetSql(SqlType.Update); return(ExceteSql <bool>(sqlStr, parameters, command => { var result = command.ExecuteNonQuery(); return result == 1; })); }