Bastieww
Please help a probably really dumb guy (API)
Hey everyone, I'm currently doing an API and I'm pretty sure I'm doing something bad : I have MANY classes, that I designed to be use as an API and for code-first usage (school project, we had no choice). For example, here is the Couleur class :
It's one of the tiniest classes among the project. In order to post a new couleur, I would like to just pass the following json :
BUT : when i try to do so, i get this error :
So I added the VariantesCouleurProduitCouleur, which is the navigation property between Couleur and VariantesCouleurProduit ;
and that worked.
9 replies
Creating 2 one-to-one relationships with a composite foreign key, EF Code First
Hello everyone,
I'm trying to make a database with 2 one-to-one relationships with a composite foreign key,, with this kind of structure :
ProductWithColor (that has an Id), Size (that has an Id) and Stock (which has not Id, but a composite Key composed by ProductWithColorId and SizeId). This is code-first, so I'm trying to generate my database with this code
I tried everything I found on the Internet, but I can't achieve this. Can anyone help ? Thanks !!
6 replies