_apix
❔ EF Core Code-first relationships
Hi there, I am trying to create a coffee vending machine application. But, I can't quite work the relationships around my head.
The project requires to have pre-defined coffees (espresso, macchiato, latte, etc.) so that the user would be able to pick from, and characteristics (sugar, milk, creamer, etc.) that can be added to a picked coffee.
I've created the following entities:
I want to be able to store the created coffees linked with the chosen characteristics in a separate table "SoldCoffes". To my understanding, I need to have one-to-many relationship, but I'm kind of stuck on this one.
Any help would be appreciated.
18 replies