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

            if (predictionSchedules.Any())
            {
                _dbContext.RemoveRange(predictionSchedules);
            }
        }
Ejemplo 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);
        }
Ejemplo n.º 3
0
 public int Count() => _dbContext.Query <EfficiencySettingsEntity>().Count();
Ejemplo n.º 4
0
 public virtual int Count() => _dbContext.Query <TenantSettingsEntity>().Count();
Ejemplo n.º 5
0
 public int Count() => _dbContext.Query <LanguageEntity>().Count();
Ejemplo n.º 6
0
 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();
Ejemplo n.º 13
0
 public int Count() => _dbContext.Query <PassEntity>().Count();
Ejemplo n.º 14
0
 public int Count() =>
     _dbContext.Query<ChannelEntity>().Count();
 public int Count() => _dbContext.Query <RecommendationEntity>().Count();
Ejemplo n.º 16
0
 public int Count() => _dbContext.Query <RestrictionEntity>().Count();
 public int Count() => _dbContext.Query <TenantProductFeatureEntity>().Count();
Ejemplo n.º 18
0
 public int Count() => _dbContext.Query <UniverseEntity>().Count();
 public int Count() => _dbContext.Query <MSTeamsAuditEventSettingsEntity>().Count();
Ejemplo n.º 20
0
 public int Count() => _dbContext.Query <SponsorshipEntity>().Count();
 public int Count() => _dbContext.Query <SmoothConfigurationEntity>().Count();
Ejemplo n.º 22
0
 public int Count() => _dbContext.Query <RuleEntity>().Count();
 public int Count() => _dbContext.Query <AutopilotSettingsEntity>().Count();
 public int Count() => _dbContext.Query <ScenarioResultEntity>().Count();
Ejemplo n.º 25
0
 public int Count() => _dbContext.Query <BookingPositionGroupEntity>().Count();
Ejemplo n.º 26
0
 public int Count() => _dbContext.Query <SpotPlacementEntity>().Count();
Ejemplo n.º 27
0
 public int Count() => _dbContext.Query <OutputFileEntity>().Count();
Ejemplo n.º 28
0
 public int Count() => _dbContext.Query <AutopilotRuleEntity>().Count();
 public int Count() => _dbContext.Query <EmailAuditEventSettingsEntity>().Count();
Ejemplo n.º 30
0
 public int Count() => _dbContext
 .Query <ImagineCommunications.GamePlan.Persistence.SqlServer.Entities.Tenant.Failures.Failure>()
 .Count();