I am doing a simple edit in ASP.NET MVC. The action result code is below. This example here says I can do the following.
Code example:
public ActionResult Edit(int id)
{
using (var db = new BlogDataEntities())
{
return View(db.Blogs.Find(id));
}
}
But when I try to do it, I cannot get Find property for db.Amodel.?
What am I missing?
My code:
public ActionResult Edit(string id)
{
using (var db = new dbAEntities())
{
return View(db.Amodel.Find(id));//This is not working. Find is not
//recognzied and intellisense does
//not give me that option too.
}
}
Amodeldoesn't have aFind()method.Amodel? Does it have similar characteristics toBlogs, i.e. was it created using Database First?