1

我是 ASP.NET MVC 的新手,尽管可以称自己为 Web 表单领域的经验丰富的程序员。我现在正在学习MVC。尝试使用实体框架取消添加控制器。下面是模型类的代码:

Imports System.Data.Entity
Public Class Users
    Public Property ID() As Integer
    Public Property Login() As String
    Public Property Password() As String
    Public Property Avatar() As Image
    Public Property Country() As Integer
    Public Property City() As Integer
    Public Property Phone() As String
    Public Property Email() As String
    Public Property Registered() As Date
End Class
Public Class StopSaleDBContext
    Inherits DbContext
    Public Property Users() As DbSet(Of Users)
End Class

当我添加控制器时,出现错误无法从 ProjectName.Users 检索元数据对象引用未设置为对象实例。

4

1 回答 1

0

编译您的项目并重试。

于 2012-09-17T23:14:44.697 回答