I added a new ADO.Net Entity Data Model into my project and used the Update Wizard to add tables into the model. Five of the selected tables were added to the design surface. Two other tables will not add. I select them in the wizard and click Finish, yet they never show up on the design surface.
Is this a bug, or are there some situations where a table cannot be added to the model (by design)?
UPDATE: The XML (*.edmx) reveals the problem.
<!--Errors Found During Generation:
warning 6013: The table/view 'FooBar.dbo.Roles' does not
have a primary key defined and no valid primary key could be inferred.
This table/view has been excluded. To use the entity you will need to
review your schema, add the correct keys and uncomment it.-->
<!--<EntityType Name="Roles">
<Property Name="role_id" Type="decimal" />
<Property Name="role_desc" Type="nvarchar" MaxLength="30" />
</EntityType>-->
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…