Skip to content

Exception thrown while attempting to evaluate the LINQ query parameter expression #792

Discussion options

You must be logged in to vote

Hi, so the root problem is that it doesn’t know the tenant at the time the db context was created.

Typically in seeding it is not part of an actual request or user action so there is no tenant that makes sense. is the data you want to seed per tenant or global?

For the former, one option I’ve used successfully is to loop through my tenants and create a standalone db context for the current tenant and deed it as needed. Also I reused this logic for any new tenant created to seed its data at the time the tenant was registered.

For the latter, I’ve used a dummy or default tenant that allows me to get the db context to set non per tenant data as needed but isn’t a real tenant/customer.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by MarcoGaribaldi
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
3 participants