天天看点

Dapper:The member of type SeoTKD cannot be used as a parameter Value

 异常汇总:http://www.cnblogs.com/dunitian/p/4523006.html#dapper

上次说了一下Dapper的扩展Dapper.Contrib http://www.cnblogs.com/dunitian/p/5710382.html

以及这个异常:Dapper.Contrib:GetAsync<T> only supports an entity with a [Key] or an [ExplicitKey] property

这次看看新的异常:

Dapper:The member of type SeoTKD cannot be used as a parameter Value

这个的根本是因为模型字段和数据库不匹配导致的(好像之前是可以的)

数据库中并没有SeoInfo这个属性(EF里面导航属性用的还是比较多的,这次换Dapper,这个肯定是少不了的,于是就折中了下,看看能不能让Dapper忽略这个属性)

解决方法:设置不可写特性,write(false)

Dapper:The member of type SeoTKD cannot be used as a parameter Value

收工

作者:毒逆天

出处:https://www.cnblogs.com/dotnetcrazy

打赏:<b>18i4JpL6g54yAPAefdtgqwRrZ43YJwAV5z</b>

本文版权归作者和博客园共有。欢迎转载,但必须保留此段声明,且在文章页面明显位置给出原文连接!

继续阅读