太坑了,访问量大了,就偶尔出现
System.Data.DataException: Error parsing column 1 (websetting={"iswebshow":1,"moneytype":1,"showminmoney":0.0,"logo":null,"sevicelink":null,"gamesitelink":null,"notice":null} - String) ---> System.InvalidCastException: 从“System.String”到“GamePal.Model.UserPay.UserPay_Rule_WebModel”的强制转换无效。
重启IIS应用程序池就搞定,就像一个定时炸弹,没办法,换回了Sqlhelper,还是取出来,手动反序列化比较好
StringBuilder strSql = new StringBuilder(); strSql.Append("select ruleid, websetting, createtime, rulename, userid, offstarttime, offendtime, replacestr, payrate, paymodel, limitsetting ,isuse "); strSql.Append(" from TB_U_UserPay_Rule "); strSql.Append(" where ruleid=@ruleid"); SqlMapper.AddTypeHandler(new JsonConvertHandler<UserPay_Rule_LimitModel>()); SqlMapper.AddTypeHandler(new JsonConvertHandler<UserPay_Rule_WebModel>()); return DapperHelper.QuerySingleOrDefault<TB_U_UserPay_RuleModel>(strSql.ToString(), new { ruleid });