ef-model-first

EntitySet System.InvalidOperationException - “the entity type is not part of the model for the current context”

大兔子大兔子 提交于 2019-11-27 06:55:22
问题 Similar Questions The entity type <classname> is not part of the model for the current context -and- EF 4.1 Code First error - The entity type SomeType is not part of the model for the current context are similar questions but they are "code first" perspective only, with much simpler data models, and address connection string and mapping issues. Please look closely at this one. Symptom // HomeController.cs public ActionResult Index() { var _db = new MealsContext(); var m = _db.Meals.ToList();

EF Model First or Code First Approach?

你离开我真会死。 提交于 2019-11-26 18:57:08
问题 I know this question has been asked numerous times before as I’ve read quite a few posts on the topic about the pros and cons etc but I still can’t decide which approach is right for me. I’m very new to web programming and come from a SQL DB Admin / report writing background. I’ve decided to try build my own website which may end up having 30 -40 tables maybe more in the future. I’ve looked at both approaches and I do favour Entity Model approach only because I like simplicity of the designer