The automatically generated foreigh keys in sec_group and sec_group_hierarchy tbles are different. there is only one fk in sec_group - sec_group_parent, whereas there are two fk in sec_group_parent tables - sec_group_hierarchy_group and sec_group_hierarchy_parent.
This is causing problem is access to these tables form different platform. (I require this).
When I access the same database from entity framework i am getting this error
[2022-04-27T12:11:07.417Z] Error: System.InvalidOperationException: The number of properties specified for the foreign key {‘group_id’, ‘parent_id’} on entity type ‘SecGroupHierarchy’ does not match the number of properties in the principal key {‘id’} on entity type ‘SecGroup’.
Yep, it is not related to foreign keys and your reply is perfect and my question require rephrasing. But how to solve this issue. No other table from database is causing problem.
I’m not an expert in the EntityFramework.
But it seems that you are trying (somehow?) to create a compound foreign key in the entity definition by using two columns.
While there should be two separate foreign keys, each of them is using one column: