I am developing a multi-tenant application using MVC. Once I launch my application in browser I find the TenantId
and assign in to static
property to maintain across the application like
public static int TenantId
{
get { return _tenantId; }
set
{
_tenantId = value;
string path = HttpContext.Current.Request.ApplicationPath;
TenantConfigurationModel tenantConfiguration = HospitalFacade.GetTenantIdByUrl(path);
if (tenantConfiguration != null)
{
_tenantId = tenantConfiguration.TenantId;
}
}
}
But my co developers suggest session
What is the best way to maintain single props value across the application?
Is any advantages/disadvantage using static property ?