Is EF4 a complex type with a navigation property (is this possible) or alternatives?

I hit the wall using the EF4 model with the first DB approach using Linq-to-Entities with POCO ...

I have two tables: Customer and NamePrefix , associated with NamePrefixId . Columns:

 Customer NamePrefix ---------- ---------- CustomerId (PK) NamePrefixId (PK) NamePrefixId (FK) LastName FirstName MiddleInitial .... 

In this case, the Customer object has the navigation property NamePrefix . I created a complex type of NameOfPerson so that I can use it in other objects. The complex type consists of NamePrefixId , LastName , FirstName , MiddleInitial . But now I get the following error message in the navigation property: NamePrefix :

 Error 111: There is no property with name 'NamePrefixId' defined in type referred by Role 'Customer'. 

Is there any way to do this?

+2
source share
1 answer

This is described directly in the help page of a complex type . Complex types cannot contain navigation properties.

+1
source

All Articles