How does MS Entity Framework map from the conceptual model to CLR types?

后端 未结 1 903
甜味超标
甜味超标 2021-01-21 19:54

Given an Entity Data Model (EDMX) with \"Code Generation Strategy\" set to \"None\", how does EF determine which CLR types to map the conceptual model to?

I think I rea

相关标签:
1条回答
  • 2021-01-21 20:33

    Notice this comment from the ADO.NET team blog:

    Jeff 25 Feb 2010 9:10 AM @Derek

    This is intentional. You can put your POCO classes in whatever namespace you'd like. The Entity Framework's by convention mechanism for detecting which properties on the entity match the properties of entities in your model does not use Namespace. What matters is that the type name (without namespace) matches the EntityType name in your model (edmx/csdl file).

    One area to watch out for is if you have multiple types with the same name but in different namespaces. Because we don't account for namespace, we detect that we've found multiple types and we throw an exception.

    Jeff

    See this article: link text

    0 讨论(0)
提交回复
热议问题