DEV Community

Discussion on: Multi-Tenant Applications with ASP.NET Core 2.2 - Getting Started

Collapse
 
garethdebruyn profile image
garethdebruyn

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);

Collapse
 
agrothe profile image
Andrew Grothe

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.