How to solve this exception “Could not find a setter for property 'ProductCode' in class … ”

∥☆過路亽.° 提交于 2019-12-05 03:21:34

Solution

If you are executing the SQL with NHibernate, verify the Alias Name of the column in your sql. The name should be exactly as name the property in your class.


e.g. incorrect:

select Product_Id as "ProductCode " 
from Products

See the white space in alias name. This can be cause of your error.

Check the alias name for all columns in your sql.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!