// what about localhost or default site address .. saas index page?? public void SetTenantStatus(SAASType sAASType) { if (!sAASType.Equals(SAASType.NoSaas)) { RFDB db = new RFDB(); string siteURL = new Http().HttpContext.Request.Host.Value.Split('.')[0]; if (!string.IsNullOrEmpty(siteURL)) // why i need this at least i will get localhost { Tenant tenant = new Tenant(); var cookieTenant = cookieManager.Get("_tenant"); if (!string.IsNullOrEmpty(cookieTenant)) { tenant.SubdomainPrefix = cookieTenant; } else { tenant = db.Get <Tenant>(exp => exp.SubdomainPrefix == siteURL, new SaasRoutingContext()).FirstOrDefault(); } if (tenant != null) { cookieManager.Set("_tenant", tenant.SubdomainPrefix); CurrentTenant = tenant.SubdomainPrefix; if (tenant.IsPendingUpdate) { db.ExecuteSQLFile(tenant.UpdateSQL, this, siteURL); } } } } }
public DefaultMSSQLContext(SAASType sAASType) : base("DefaultConnection", sAASType) { }
public RFCoreDbContext(string connectionStirng, SAASType sAASType) { this.sAASType = sAASType; this.connectionStirng = connectionStirng; SetTenantStatus(sAASType); }
public TestBase(SAASType sAASType) : base("MSSQLConnection", sAASType) { }