public TenantResolver(MasterContext context, IHttpContextAccessor accessor, IAliasRepository aliasrepository, ITenantRepository tenantrepository) { db = context; _aliasrepository = aliasrepository; _tenantrepository = tenantrepository; // get alias based on request context aliasname = accessor.HttpContext.Request.Host.Value; string path = accessor.HttpContext.Request.Path.Value; string[] segments = path.Split('/'); if (segments[0] == "api" && segments[1] != "~") { aliasname += "/" + segments[1]; } if (aliasname.EndsWith("/")) { aliasname = aliasname.Substring(0, aliasname.Length - 1); } }
public AliasRepository(MasterContext context, IMemoryCache cache) { db = context; _cache = cache; }