Exemple #1
0
 public TenantTasks(Tenant tenant, PlsDbContext db, IOptions <AlcuinOptions> opt, IIisService iis, ConfigDatabaseServiceFactory cfgDbFactory)
 {
     _opt    = opt;
     _iis    = iis;
     Dto     = tenant ?? throw new ArgumentNullException(nameof(tenant));
     _server = db.Servers.Find(tenant.ServerId);
     _cfgDb  = cfgDbFactory(_server.ConnectionString(), tenant.ConfigDb);
 }
        public static void Upsert <T, TKey>(this PlsDbContext db, T newItem, Expression <Func <T, TKey> > on)
            where T : class
        {
            if (newItem == null)
            {
                throw new ArgumentNullException(nameof(newItem));
            }
            if (@on == null)
            {
                throw new ArgumentNullException(nameof(@on));
            }
            var id = on.Compile()(newItem);
            T   item;

            if ((item = db.Find <T>(id)) != null)
            {
                item.InjectFrom(newItem);
            }
            else
            {
                db.Add(newItem);
            }
        }
 public AddTenantCommandBuilder(PlsDbContext db)
 {
     _db = db;
 }
Exemple #4
0
 public BackupTenantCommandBuilder(PlsDbContext db)
 {
     _db = db;
 }
 public ServerListCommandBuilder(
     PlsDbContext db)
 {
     _db = db;
 }
Exemple #6
0
 public DropTenantCommandBuilder(PlsDbContext db, TenantTasksFactory t)
 {
     _db = db;
     _t  = t;
 }
Exemple #7
0
 public RestoreDbCommandBuilder(PlsDbContext db)
 {
     _db = db;
 }
Exemple #8
0
 public AddServerCommandBuilder(PlsDbContext db)
 {
     _db = db;
 }
Exemple #9
0
 public MigrateTenantCommandBuilder(PlsDbContext db, IOptions <AlcuinOptions> options)
 {
     _db      = db;
     _options = options.Value;
 }
 public CopyTenantCommandBuilder(PlsDbContext db, TenantTasksFactory tn)
 {
     _db = db;
     _tn = tn;
 }
Exemple #11
0
 public CopyDbCommandBuilder(PlsDbContext db)
 {
     _db = db;
 }
 public TenantListCommandBuilder(PlsDbContext db, TenantTasksFactory tt)
 {
     _db = db;
     _tt = tt;
 }
 public CreateWebAppCommandBuilder(PlsDbContext db, TenantTasksFactory t)
 {
     _db = db;
     _t  = t;
 }
 public DbListServerCommandBuilder(PlsDbContext db)
 {
     _db = db;
 }