Unable to cast object of type 'System.String' to type 'System.Int32'.

原因 数据库中 code 字段 类型为 varchar 而实体的类型为 int  导致string 类型无法转化为int 类型而报错

        public int code { get; set; }

 参考:https://www.cnblogs.com/Godric/p/10111594.html

posted @ 2019-09-28 16:27  liliyou  阅读(797)  评论(0编辑  收藏  举报