列名无效。 Extent1,列名= ... c#EF MVC

时间:2013-09-13 04:08:37

标签: c# entity-framework sql-server-ce

像标题所说,我收到了错误:

The column name is not valid. [ Node name (if any) = Extent1,Column name = marketplace ]

“marketplace”在代码中没有出现,IS是表中列的名称。

给出错误的SQl语句是:

SELECT [Extent1].[id] AS [id], 
[Extent1].[marketplace] AS [marketplace], 
[Extent1].[c1] AS [c1], 
[Extent1].[name] AS [name], 
[Extent1].[description] AS [description], 
[Extent1].[c2] AS [c2], 
[Extent1].[c3] AS [c3], 
[Extent1].[c4] AS [c4], 

并且无论订单如何,它都会在列市场上给出错误。

另外一个问题是,marketplace列必须是NOT NULL,但数据库中会满足此条件。

我使用“逆向工程师代码第一个命令”使用EF生成这个,并且在尝试将Entity类转换为列表时出现错误。

有人有什么想法吗?

0 个答案:

没有答案