Skip to content

Using Tenant ID instead of Tenant Name in AddNewUserAsync\UpdateUserAsync methods #72

Answered by JonPSmith
tsygankov asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @tsygankov,

I used the tenant name in the AddNewUserAsync or UpdateUserAsync because it gave better error messages if the tenant isn't found, e.g $"A tenant with the name '{tenantName}' wasn't found.".

You have many ways to get around this, but I think the best approach is storing the tenant name in your Organizations table in your domain entities. If the tenant name changes, then you can use the ITenantChangeService.SingleTenantUpdateNameAsync to update your Organizations table.

This approach means you don't have to create your own AddNewUserAsync and UpdateUserAsync with Tenant ID parameter, which will be outdated when the next release comes out which adds multilanguage handling of a…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by tsygankov
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
None yet
2 participants