Possible to use a class as composite key in entity framework?
Is there any way to do something like this?
8 Replies
why does a book id have a storefront
if you want strongly typed ids you can use something like vogen
GitHub
GitHub - SteveDunn/Vogen: A semi-opinionated library which is a sou...
A semi-opinionated library which is a source generator and a code analyser. It Source generates Value Objects - SteveDunn/Vogen
Just an example, in my actual usecase this makes a lot more sense
My app lets people browse products from multiple different storefronts
each storefront has it's own Id system, so obv if I just use that I can get overlap between Ids, so I want composite
i dont see why you dont just use another id column or something
That's what I ended up doing
Literally the only reason I wanted to do this is cause my productidentifier class knows how to get the URL for that product, but it's honestly probably best to separate that stuff
and also passing at least 2 params to every function related to querying a product is annoying