When you have a condition like myColumn Is Not Null, you must map the column on a non nullable property BUT with EF v1, you can’t map the column on a relationship (even if the cardinality is one).
I have two tables:
- CustomerId (PK)
- ContactId (PK)
- CustomerId (FK to Customers.CustomerId NULL)
In my EDM, I want three entity types:
- Contact (with no association to Customer)
- CustomerContact (with an association to Customer)
- I delete the relationship in MSL, CSDL and SSDL.
- I use TPH between CustomerContact and Contact with CustomerId Is Null for Contact and CustomerId IsNot Null for CustomerContact.
- Then I add an association between CustomerContact and Customer with a cardinality one to many.
I have an error:
Error 3022: Problem in Mapping Fragment starting at line 63: Property Contacts.CustomerId with ‘IsNull=false’ condition must be mapped.
But it’s wrong. I mapped Contacts.CustomerId on the relationship.