且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Dapper.Contrib:GetAsync only supports an entity with a [Key] or an [ExplicitKey] property

更新时间:2021-09-29 23:38:35

异常处理:http://www.cnblogs.com/dunitian/p/4523006.html#dapper

原来Model是这样滴

Dapper.Contrib:GetAsync<T> only supports an entity with a [Key] or an [ExplicitKey] property

修改后是这样滴

Dapper.Contrib:GetAsync<T> only supports an entity with a [Key] or an [ExplicitKey] property

注意点:Model里面的Table和Key是Dapper.Contrib.Extensions命名空间下的

成功~ 

Dapper.Contrib:GetAsync<T> only supports an entity with a [Key] or an [ExplicitKey] property

 


本文转自毒逆天博客园博客,原文链接:http://www.cnblogs.com/dunitian/p/5710467.html,如需转载请自行联系原作者