public void DeleteRange(IEnumerable <int> ids)
        {
            var predictionSchedules = _dbContext.Query <PredictionSchedule>()
                                      .Where(x => ids.Contains(x.Id))
                                      .ToArray();

            if (predictionSchedules.Any())
            {
                _dbContext.RemoveRange(predictionSchedules);
            }
        }
Esempio n. 2
0
        public void Execute(ISqlServerDbContext dbContext, Expression <Func <TEntity, int> > entitySequencePropertyExpression)
        {
            if (dbContext == null)
            {
                throw new ArgumentNullException(nameof(dbContext));
            }

            if (!dbContext.Specific.Database.IsSqlServer())
            {
                return;
            }

            var max = dbContext.Query <TEntity>()
                      .Select(entitySequencePropertyExpression)
                      .DefaultIfEmpty()
                      .Max() + 1;

            var schema = dbContext.Specific.Model.Relational()?.DefaultSchema;
            var sequenceNameWithSchema = string.IsNullOrEmpty(schema)
                ? $"[{typeof(TSequence).Name}]"
                : $"[{schema}].[{typeof(TSequence).Name}]";
            var query = new RawSqlString($"ALTER SEQUENCE {sequenceNameWithSchema} RESTART WITH {max} NO CACHE");

            dbContext.Specific.Database.ExecuteSqlCommand(query);
        }
Esempio n. 3
0
 public int Count() => _dbContext.Query <EfficiencySettingsEntity>().Count();
Esempio n. 4
0
 public virtual int Count() => _dbContext.Query <TenantSettingsEntity>().Count();
 public int Count() => _dbContext.Query <LanguageEntity>().Count();
 public int Count() => _dbContext.Query <FacilityEntity>().Count();
 public int Count() =>
 _dbContext.Query <SmoothFailureMessageEntity>().Count();
 public int Count() => _dbContext.Query <ISRSettingsEntity>().Count();
 public int Count() => _dbContext.Query <MasterEntitites.UpdateDetails>().Count();
 public int Count() => _dbContext
 .Query <ScenarioCampaignMetricEntity>()
 .Count();
 public int Count() => _dbContext.Query <FlexibilityLevelEntity>().Count();
 public int Count() => _dbContext.Query <LibrarySalesAreaPassPriorityEntity>().Count();
Esempio n. 13
0
 public int Count() => _dbContext.Query <PassEntity>().Count();
Esempio n. 14
0
 public int Count() =>
     _dbContext.Query<ChannelEntity>().Count();
 public int Count() => _dbContext.Query <RecommendationEntity>().Count();
Esempio n. 16
0
 public int Count() => _dbContext.Query <RestrictionEntity>().Count();
 public int Count() => _dbContext.Query <TenantProductFeatureEntity>().Count();
Esempio n. 18
0
 public int Count() => _dbContext.Query <UniverseEntity>().Count();
 public int Count() => _dbContext.Query <MSTeamsAuditEventSettingsEntity>().Count();
Esempio n. 20
0
 public int Count() => _dbContext.Query <SponsorshipEntity>().Count();
 public int Count() => _dbContext.Query <SmoothConfigurationEntity>().Count();
Esempio n. 22
0
 public int Count() => _dbContext.Query <RuleEntity>().Count();
 public int Count() => _dbContext.Query <AutopilotSettingsEntity>().Count();
 public int Count() => _dbContext.Query <ScenarioResultEntity>().Count();
Esempio n. 25
0
 public int Count() => _dbContext.Query <BookingPositionGroupEntity>().Count();
Esempio n. 26
0
 public int Count() => _dbContext.Query <SpotPlacementEntity>().Count();
 public int Count() => _dbContext.Query <OutputFileEntity>().Count();
Esempio n. 28
0
 public int Count() => _dbContext.Query <AutopilotRuleEntity>().Count();
 public int Count() => _dbContext.Query <EmailAuditEventSettingsEntity>().Count();
Esempio n. 30
0
 public int Count() => _dbContext
 .Query <ImagineCommunications.GamePlan.Persistence.SqlServer.Entities.Tenant.Failures.Failure>()
 .Count();