【问题标题】:VB entitytype has no key defined. define the key for this entitytypeVB 实体类型没有定义键。定义此实体类型的键
【发布时间】:2016-01-23 22:03:11
【问题描述】:

我要求为 VB 而不是 C# 提供解决方案。因此,我的问题开始处的“VB”标签。

尝试为我的模型创建控制器,但是,我不断收到“entitytype has no key defined. define the key for this entitytype”。我正在使用 VB MVC5。

【问题讨论】:

标签: asp.net-mvc vb.net model-view-controller


【解决方案1】:

解决方案是将 dataannotations 和 dataannotations.schema 导入您的模型,编译它,然后添加您的控制器。另外,请确保您的类具有 int 属性。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-08-29
    • 2015-01-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-23
    • 2021-11-27
    • 2018-08-13
    相关资源
    最近更新 更多