Exemplo n.º 1
0
        public virtual void RemoveConnectionString(string name)
        {
            TenantConnectionString tenantConnectionString = this.ConnectionStrings.FirstOrDefault(x => x.Name == name);

            if (tenantConnectionString != null)
            {
                this.ConnectionStrings.Remove(tenantConnectionString);
            }
        }
Exemplo n.º 2
0
        public virtual string FindConnectionString(string name)
        {
            TenantConnectionString tenantConnectionString = this.ConnectionStrings.FirstOrDefault(x => x.Name == name);

            if (tenantConnectionString == null)
            {
                return(null);
            }
            return(tenantConnectionString.Value);
        }
Exemplo n.º 3
0
        public virtual void SetConnectionString(string name, string connectionString)
        {
            TenantConnectionString tenantConnectionString = this.ConnectionStrings.FirstOrDefault(x => x.Name == name);

            if (tenantConnectionString != null)
            {
                tenantConnectionString.SetValue(connectionString);
                return;
            }
            this.ConnectionStrings.Add(new TenantConnectionString(this.Id, this.Name, connectionString));
        }