csdl

Entity Framework - Entity Mapping problem

百般思念 提交于 2019-12-12 13:12:10
问题 I have two tables: Address and Contact which are joined on contactID (in Contact). Both of these tables have entities in my Entity data model (EF 4.0) and I do not wan't to modify them. I do want to create a new entity that contains information from both entities. What I did so far: In CSDL: <EntityContainer...> <EntitySet Name="AddressTest" EntityType="WebGearsModel.Test" /> <EntitySet Name="ContactTest" EntityType="WebGearsModel.Test" /> </EntityContainer> <EntityType Name="Test"> <Key>

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

喜欢而已 提交于 2019-11-28 12:21:39
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(); var d = _db.Drinks.ToList(); return View(); } Exception is thrown retrieving the Drinks collection:

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();