我是ASP.NET MVC的新手,尽管可以称自己为Web表单领域的程序员。 我现在正在学习MVC。尝试添加具有Entity框架abolities的控制器。 以下是模型类的代码:
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检索元数据对象引用未设置为对象实例。
答案 0 :(得分:0)
编译项目并重试。