public void DeleteRange(IEnumerable <int> ids) { var predictionSchedules = _dbContext.Query <PredictionSchedule>() .Where(x => ids.Contains(x.Id)) .ToArray(); if (predictionSchedules.Any()) { _dbContext.RemoveRange(predictionSchedules); } }
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); }
public int Count() => _dbContext.Query <EfficiencySettingsEntity>().Count();
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();
public int Count() => _dbContext.Query <PassEntity>().Count();
public int Count() => _dbContext.Query<ChannelEntity>().Count();
public int Count() => _dbContext.Query <RecommendationEntity>().Count();
public int Count() => _dbContext.Query <RestrictionEntity>().Count();
public int Count() => _dbContext.Query <TenantProductFeatureEntity>().Count();
public int Count() => _dbContext.Query <UniverseEntity>().Count();
public int Count() => _dbContext.Query <MSTeamsAuditEventSettingsEntity>().Count();
public int Count() => _dbContext.Query <SponsorshipEntity>().Count();
public int Count() => _dbContext.Query <SmoothConfigurationEntity>().Count();
public int Count() => _dbContext.Query <RuleEntity>().Count();
public int Count() => _dbContext.Query <AutopilotSettingsEntity>().Count();
public int Count() => _dbContext.Query <ScenarioResultEntity>().Count();
public int Count() => _dbContext.Query <BookingPositionGroupEntity>().Count();
public int Count() => _dbContext.Query <SpotPlacementEntity>().Count();
public int Count() => _dbContext.Query <OutputFileEntity>().Count();
public int Count() => _dbContext.Query <AutopilotRuleEntity>().Count();
public int Count() => _dbContext.Query <EmailAuditEventSettingsEntity>().Count();
public int Count() => _dbContext .Query <ImagineCommunications.GamePlan.Persistence.SqlServer.Entities.Tenant.Failures.Failure>() .Count();