public void Add(ApprovedDomain domain) { var domains = this.Get(); domains.Add(domain); this.Save(domains); }
public void Add(ApprovedDomain domain) { var domains = this.Get(); bool found = domains.Any(x => x.DomainName.ToUpperInvariant().Equals(domain.DomainName.ToUpperInvariant())); if (!found) { domains.Add(domain); this.Save(domains); } }
public static void Setup(ApprovedDomain domain) { var factory = new StdSchedulerFactory(); var scheduler = factory.GetScheduler(); scheduler.Start(); var job = JobBuilder.Create<InstallJob>().WithIdentity(domain.DomainName, "install").Build(); var trigger = TriggerBuilder.Create().WithIdentity(domain.DomainName, "install-trigger").StartAt(DateTimeOffset.UtcNow.AddSeconds(5)).Build(); scheduler.ScheduleJob(job, trigger); }
public string GetBackupDirectory(ApprovedDomain domain, string tenant) { if (domain.BackupDirectoryIsFixedPath && !string.IsNullOrWhiteSpace(domain.BackupDirectory)) { return domain.BackupDirectory; } if (!string.IsNullOrWhiteSpace(domain.BackupDirectory)) { return HostingEnvironment.MapPath(domain.BackupDirectory); } string path = $"/Backups/{tenant}/backup"; return HostingEnvironment.MapPath(path); }
public void Add(ApprovedDomain domain) { this.Domains.Add(domain); }
public static async Task AddAsync(ApprovedDomain tenant) { string database = TenantConvention.GetDbNameByConvention(tenant.DomainName); var sql = new Sql("INSERT INTO account.installed_domains(domain_name, admin_email) SELECT @0, @1;", tenant.DomainName, tenant.AdminEmail); await Factory.NonQueryAsync(database, sql).ConfigureAwait(false); }