c# - Entity framework relationship issue 'Unable to determine the principal end...' -


I have two squares, like

  class one {id (pk) Property 2; } I'm getting an error while saving the class two {ID (PK), an_ID (FK), Enlabal_on_id (FK)}  

'Unable to determine the main end of X "Relationships can be the same primary key in multiple joint ventures. I tried many combinations WithOutPrincipal and WithOutDependant etc. But no luck, please guide me in the right relationship.

If you are trying to keep 1 to 0 or 1 relationship between squares, one and two sections You need the same key in Primary Key and Class 2 and this should be the primary key for Class One

Class A {ID (PK), Property 2; }

class two {one_id (pk, fk), enlabal_on_id (fk)}


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -