public Alias UpdateAlias(Alias Alias)
 {
     db.Entry(Alias).State = EntityState.Modified;
     db.SaveChanges();
     _cache.Remove("aliases");
     return(Alias);
 }
Example #2
0
 public void UpdateModuleDefinition(ModuleDefinition moduleDefinition)
 {
     _db.Entry(moduleDefinition).State = EntityState.Modified;
     _db.SaveChanges();
     _permissions.UpdatePermissions(moduleDefinition.SiteId, EntityNames.ModuleDefinition, moduleDefinition.ModuleDefinitionId, moduleDefinition.Permissions);
     _cache.Remove("moduledefinitions:" + moduleDefinition.SiteId.ToString());
 }
Example #3
0
 public Job UpdateJob(Job job)
 {
     _db.Entry(job).State = EntityState.Modified;
     _db.SaveChanges();
     _cache.Remove("jobs");
     return(job);
 }
 public Tenant UpdateTenant(Tenant Tenant)
 {
     db.Entry(Tenant).State = EntityState.Modified;
     db.SaveChanges();
     _cache.Remove("tenants");
     return(Tenant);
 }
 public void UpdateAlias(Alias alias)
 {
     try
     {
         db.Entry(alias).State = EntityState.Modified;
         db.SaveChanges();
     }
     catch
     {
         throw;
     }
 }
Example #6
0
 public void UpdateTenant(Tenant tenant)
 {
     try
     {
         db.Entry(tenant).State = EntityState.Modified;
         db.SaveChanges();
     }
     catch
     {
         throw;
     }
 }
Example #7
0
 public Alias UpdateAlias(Alias Alias)
 {
     try
     {
         db.Entry(Alias).State = EntityState.Modified;
         db.SaveChanges();
         return(Alias);
     }
     catch
     {
         throw;
     }
 }
Example #8
0
 public Tenant UpdateTenant(Tenant Tenant)
 {
     try
     {
         db.Entry(Tenant).State = EntityState.Modified;
         db.SaveChanges();
         return(Tenant);
     }
     catch
     {
         throw;
     }
 }
        public Tenant UpdateTenant(Tenant tenant)
        {
            var oldTenant = _db.Tenant.AsNoTracking().FirstOrDefault(t => t.TenantId == tenant.TenantId);

            if (oldTenant != null && (oldTenant.Name.Equals(Constants.MasterTenant, StringComparison.OrdinalIgnoreCase) && !oldTenant.Name.Equals(tenant.Name)))
            {
                throw new InvalidOperationException("Unable to rename the master tenant.");
            }

            _db.Entry(tenant).State = EntityState.Modified;
            _db.SaveChanges();
            _cache.Remove("tenants");
            return(tenant);
        }
Example #10
0
 public Setting UpdateSetting(Setting setting)
 {
     if (IsMaster(setting.EntityName))
     {
         _master.Entry(setting).State = EntityState.Modified;
         _master.SaveChanges();
     }
     else
     {
         _tenant.Entry(setting).State = EntityState.Modified;
         _tenant.SaveChanges();
     }
     return(setting);
 }
Example #11
0
 public Job UpdateJob(Job Job)
 {
     db.Entry(Job).State = EntityState.Modified;
     db.SaveChanges();
     return(Job);
 }
 public Schedule UpdateSchedule(Schedule Schedule)
 {
     db.Entry(Schedule).State = EntityState.Modified;
     db.SaveChanges();
     return(Schedule);
 }
 public void UpdateModuleDefinition(ModuleDefinition moduleDefinition)
 {
     _db.Entry(moduleDefinition).State = EntityState.Modified;
     _db.SaveChanges();
     _permissions.UpdatePermissions(moduleDefinition.SiteId, EntityNames.ModuleDefinition, moduleDefinition.ModuleDefinitionId, moduleDefinition.Permissions);
 }
Example #14
0
 public JobLog UpdateJobLog(JobLog JobLog)
 {
     db.Entry(JobLog).State = EntityState.Modified;
     db.SaveChanges();
     return(JobLog);
 }
 public ScheduleLog UpdateScheduleLog(ScheduleLog ScheduleLog)
 {
     db.Entry(ScheduleLog).State = EntityState.Modified;
     db.SaveChanges();
     return(ScheduleLog);
 }