天天看點

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>

本文版權歸作者和部落格園共有。歡迎轉載,但必須保留此段聲明,且在文章頁面明顯位置給出原文連接配接!

繼續閱讀