I'm using Entity Framework Core (EF) for building models for a project.
Now I want to save companies and their hierachy. Therefore I have following cases:
- A subsidiary company (Child) has any number of children and any number of parents.
- A parent company has any number of children and any number of parents, too.
The many to many reation is hardly the problem. The real problem is the combination of many to many and the self-referencing (same table name).
I have no idea how to write a model with those cases. I hope any one can help me.
self-referencing (same table name)
– Sampath