0
Personal talk!
I have a question regarding Entity Framework 6.
I have two projects A and B, A being a shared core. It has some classes as Parents, State, City, Address etc.
In Project B, I have some classes like Candidate, Vacancy etc.
In this case, project B classes refer to project A classes, such as:
public class Candidato
{
public virtual int IdEndereco { get; set; };
public virtual Endereco Endereco { get; set; }
}
I have two contexts, one for each project. Each project will have its own database.
When starting the project, the banks are created normally for the two projects.
The problem is that for all A classes referenced by B, a table is created in the project B database.
However, these tables should only exist in the project A database.
The bank was like this:
A (Country, State, City, Address)
B (Country, State, City, Address, Candidate, Vacancy)
Are there any settings in Entity to say that A classes referenced by B should not have tables created in the project B database?
Thank you.
Of course he will create the tables, as you want to be created a relationship between two tables and one of them doesn’t even exist?
– Jéf Bueno
The table will exist, but in another bank. In case, would you have to change the class to not have a strong relationship? Type: class Candidate { public int Idendereco { get; set; } } No virtual, no Address variable
– Evolua
With the information you presented is what I think should be done, relate the Ids without creating real relationships in the database. What is the need to keep these seats separate? If it is to be a shared bank for several applications, I think it would be better to think of a more elegant solution...
– Jéf Bueno