I am writing multitenant based application and I want to load custom view from storage base on url(tenant).
I type https://corporate.myapp.local/ in browser but in FileExists
method HttpContext.Current.Request.Url
give me http://127.0.0.1/ it does not tell me which domain is this so i can get file base on domain and resolve tenantid
public class ViewPathProvider : VirtualPathProvider, ICustomVirtualPathProvider
{
VirtualPathProvider ICustomVirtualPathProvider.Instance => this;
private readonly ILogger _logger;
private readonly IThemeService _themeService;
private readonly ISellutionSession _sellutionSession;
public ViewPathProvider(ILogger logger, IThemeService themeService, ISellutionSession sellutionSession)
{
_logger = logger;
_themeService = themeService;
_sellutionSession = sellutionSession;
}
public override bool FileExists(string virtualPath)
{
_logger.Log($"CurrentCompanyId: {_sellutionSession.GetCurrentCompany(HttpContext.Current.Request.Url).CompanyId}");
var isViewExist = Pages.IsExistByVirtualPath(virtualPath);
return isViewExist || Previous.FileExists(virtualPath);
}