0

我在我的网站中添加了一个 ADO.Net 实体数据模型并将其命名为WebSocketModel。因此,它的所有代码都已在文件夹name space WebSocketModel内部生成。App Code

但现在我无法引用 this namespace。我需要使用context classes在这个里面创建的namespace来触发LINQ queries

我试图namespace通过using WebSocketModel;我的网络表单中的语句来引用,但我得到了错误

The type or namespace name 'WebSocketModel' could not be found 
(are you missing a using directive or an assembly reference?)

这个错误更令人困惑的是,每当我输入using智能感知时,都会自动建议命名空间WebSocketModel。然而,后来当我建立我的网站时,我得到了上述错误。

4

1 回答 1

1

OK 花了很长时间,但终于解决了这个问题......我只是删除了实体模型并再次添加它。这样做之后,我得到了一个新的错误:

The type 'PatientBPData' is not attributed with EdmEntityTypeAttribute but is contained in an assembly attributed with EdmSchemaAttribute. POCO entities that do not use EdmEntityTypeAttribute cannot be contained in the same assembly as non-POCO entities that use EdmEntityTypeAttribute.

为了解决这个问题,我发现非常有帮助

于 2013-02-01T07:20:51.333 回答