Many textbooks ask you to do all these extra classes that are not needed. Basically, all you need to do to work with the entity infrastructure is creating a model and then creating an object in your controller.
Model example: myEntity.edmx Controller example:
public class HomeController : Controller { myEntity db = new myEntity(); public ActionResult Index() { return View(db.myTable.ToList()); } }
Everything else is in the entity model, so when the error reads: "myEntityContext" is not part of the model "this was true, because I created an additional class called" myEntityContext "for tutorials.
When you try to create a strong representation with the context being created, it will explode because it is trying to link a class that does not exist in the model. Thus, removing all the additional DALs and the model context, creating a new view using Entity.context, which is displayed in the Strong View menu, everything should work fine.
I had the same problem and posted what I did to fix it
Jeuvin
source share