EntityFramework:An error occurred while executing the command definition. See the inner exception for details.

错误描述

调用EF中的FirstOrDefault()时,报错误:An error occurred while executing the command definition. See the inner exception for details.

解决方案

一般是代码中的表或者字段无法与数据库对应导致,检查代码中的表名称字段名称与数据库表或字段名称是否一致。

原文地址:https://www.cnblogs.com/bossing/p/11065264.html