Skip to content

Can TenantId be set automatically when part of the PK using .IsMultiTenant().AdjustKey() ? #612

Answered by AndrewTriesToCode
dirraj asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, sorry I didn't see this sooner. There is a property on MultiTenantDbContext called TenantNotSetMode which you should be able to set to Overwrite and it should set the tenant for you. Docs here.

Regarding a related entity like Posts, the filtering doesn't apply there unfortunately -- this is a limitation of global query filters which this Finbuckle functionality it based on.

Replies: 3 comments 4 replies

Comment options

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

You must be logged in to vote
4 replies
@fretje
Comment options

@AndrewTriesToCode
Comment options

@fretje
Comment options

@AndrewTriesToCode
Comment options

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