❔ Entityframework model
I have the following models in EFC, I need the server member to share the id of user Id as I do not want to make a new Id for it entierly (if thats even possible) tho i'm getting errors saying the code needs a primary key when I do define a key
19 Replies
maybe what I could do is have "Id" property thats just the value of UserId? tho that would be stupid
i've not used composite keys often, but it's kinda weird to me that you're building an anonymous object
a what?
new { }
ah, in the .HasKey() call
Yea, just I'm receiving this error
which is strange
that's the correct syntax for defining a composite key for EF
oh is it
yeah, it actually compiles to an expression, and EF parses it to see the 2 columns involved
I'm gonna have to wager the configuration isn't getting applied
most likley not
If I could ask what the correct syntax would be then
what do you have now?
oh misread
this
no, for applying the entity configuration
oh shit
i forgot to add that
😉
I just noticed
would you look at that it worked
thanks, i didnt even think about that being the issue
🎉
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.