Function Edit(ByVal id As Integer) As ActionResult
Dim entities As New Deployment_devEntities()
Dim w As System.Data.Objects.ObjectQuery(Of tblWebsites) = entities.CreateQuery(Of tblWebsites)("SELECT VALUE m FROM tblWebsites as m WHERE m.WebsiteID = " & id)
Dim q = From m In entities.tblWebsites Where m.WebsiteID = id Select m
Return View(q.Single())
End Function
I have a strong typed view of type EntityFrameworkTest.tblWebsites when I pass in the results using either Linq to Entity or Entity SQL I get this error
The model item passed into the dictionary is of type 'System.Data.Objects.ObjectQuery`1[EntityFrameworkTest.tblWebsites]', but this dictionary requires a model item of type 'EntityFrameworkTest.tblWebsites'.
What am I doing wrong?
The code is example only.