✅ Setting Foreign key as Primary Key (EF Core)

I want to set a foreign key as my primary key in a link table im using. How would I do this in EF Core? or would it be better to not have a key?
No description
No description
No description
3 Replies
TrattTratt
TrattTratt3mo ago
What do you want the table to do?, is it a many to many relationship table? Then I usually dont use the [Key] and it works (not sure if I can help you im a noob lol but im here to learn)
restingphantom
restingphantom3mo ago
this is the first time working with a more complex ef core project as well but I did excactly like you said (just making it a table without a key) and i think thats the right option now how do I close the question?
Pobiega
Pobiega3mo ago
just /close
Want results from more Discord servers?
Add your server
More Posts
Winform my button to reset my picturebox and fill it in with a new generated image is not workinghttps://hatebin.com/cslhmvmnya - my code Lines 121-124 is the methos to reset the picturebox but ImVS Project config questions1. Is it bad to enable "Place solution and project in the same folder"? It sounds neater to me but w(Blazor) I'm having trouble accessing a variable inside a parent component.I'm trying to access a simple bool in a parent component that shows when my side bar has been collap✅ There is already an open DataReader associated with this Command which must be closed firstI'm currently developing a Point Of Sale software in winforms c#. While working on cash management mC# Integration with MulesoftWe are looking to re-do an application in microservice style and biz req is pushing Mulesoft for thaVisual Studio opening search results in the search dock, not main windowKinda unrelated to C#, but since a few updates ago Visual Studio started behaving weirdly for me. Logic on properly deploying thingsSo I've been getting into a more professional workflow (id say) with better github practices, workinSystem.AggregateException: 'Some services are not able to be constructedI stuck with this problem and don't understand how to fix it: InvalidOperationException: Unable to rMAUI. How to remove the Title Bar?I need to remove the top panel so that the user can not use the buttons on it.Help me sort out perhaps badly done folder/solution structure so I can add a shared Class LibraryOk, so I have two solutions which must be separate so I can execute them both at the same time so th