2
I’m migrating a legacy Visualfox system on . Net where the tables were made all without relationship, in ADO, without Foreign key in relationships. Just comparing a string of the name "Type" to differentiate if the record in a Table, for example: Address belongs to Correspondent, Store or Customer.
The system is very large and there are several relationships similar to this for example: Store and Correspondent have a table Contact also relating the ID and differentiating by type(string).
It is very difficult to mirror this rule in EF (if possible, because I am a beginner and I am still learning). The table looks like this:
EnderecoId - ReferenceId - Tipo - Logradouro
1 - 1 - Loja - Rua tal tal tal
2 - 1 - Correspondente - Rua tal tal tal
3 - 1 - Correspondente - Rua tal tal tal
4 - 1 - Cliente - Rua tal tal tal
Is it possible to make these rules using a Type string as a way to differentiate addresses? If it is not possible, it would be right to use Composite Key in this case?
What does the last sentence mean?
– Jéf Bueno
It is that he edited the previous question, but that is a completely different doubt.
– Leonel Sanches da Silva
Related: https://answall.com/questions/201008/problemas-ao-mappingco-data-entity-framework
– Leonel Sanches da Silva