How to add navigation property for complex type Entity Framework

I am using VS2010 Beta 2, I have a complex type called Address with the following properties:

  • Street
  • City
  • Countryid

I have a Country entity defined in my model, but I cannot find a way to add a link (navigation property) from the CountryId my Complex Type property to the Id property of my Country object .

Am I doing it wrong or is it something that I cannot do with the designer? ...

Another option that I have is just to create an Address object, but it just doesn't suit me.

+3
source share
2 answers

Good,

It seems that the current version of the Entity Framework does not support the navigation property or foreign key in a complex type.

Another reasonable option is to create a separate address object that will have all the foreign keys it needs, and then create navigation properties in all my other objects.

+1
source

, , , . , . . . , , , .

+4

Source: https://habr.com/ru/post/1720914/


All Articles