Foreign key transaction in C# and Entity-

Asked

Viewed 36 times

1

Guys, in my application I have the Context class that has the Dbset of Shopping and Dbset of Products. It turns out that in my BD table, Shopping has a FK that picks up the Product ID in the column FK_ID_PROD.

Question 1: What will the mapping of this column look like in the Entity?

Question 2: Should I, in this "Shopping" class, create a list like Products or just a list of Integers and store the Product Ids?

Thank you!

  • Carlos what exactly are you trying to do?

  • From a look at the example I made, I could not post here

  • https://dotnetfiddle.net/hLbwL0

  • Marcos, thank you so much for the help man! That’s exactly what I wanted.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.