Thanks Andrew, this has really helped. Im trying to implement this in .net core 3.1.2
I get an error that says Const does not exist in the current context. What am I missing?
_httpContextAccessor.HttpContext.Items.TryGetValue(Const.CURRENT_TENANT, out object currentTenant);
Hi Gareth, Const is a class I used to keep my constants. Just replace Const.CURRENT_TENANT with "Current_Tenant" or any other string you which to use as a key in the HttpContext.Items dictionary. Updating this to .NET Core 3 is on my list of things to do.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks Andrew, this has really helped. Im trying to implement this in .net core 3.1.2
I get an error that says Const does not exist in the current context. What am I missing?
_httpContextAccessor.HttpContext.Items.TryGetValue(Const.CURRENT_TENANT, out object currentTenant);
Hi Gareth, Const is a class I used to keep my constants. Just replace
Const.CURRENT_TENANT
with "Current_Tenant" or any other string you which to use as a key in theHttpContext.Items
dictionary. Updating this to .NET Core 3 is on my list of things to do.