Beispiel #1
0
        public void AddRange(IEnumerable <SpotBookingRule> spotBookingRules)
        {
            var spotBookingRulesEntities = _mapper.Map <SpotBookingRuleEntity[]>(spotBookingRules, opts => opts.UseEntityCache(_salesAreaByNameCache));

            _dbContext.AddRange(spotBookingRulesEntities,
                                post => post.MapToCollection(spotBookingRules, opts => opts.UseEntityCache(_salesAreaByIdCache)), _mapper);
        }
Beispiel #2
0
 public void Add(MetadataModel metadata)
 {
     _dbContext.RemoveRange(_dbContext.Query <MetadataCategory>().ToArray());
     if (metadata.Any())
     {
         _dbContext.AddRange(_mapper.Map <IEnumerable <MetadataCategory> >(metadata).ToArray());
     }
 }
Beispiel #3
0
 public void Add(IEnumerable <Pass> items) =>
 _dbContext.AddRange(
     _mapper.Map <PassEntity[]>(
         items,
         opt => opt.UseEntityCache(_salesAreaByNameCache)),
     post => post.MapToCollection(
         items,
         opt => opt.UseEntityCache(_salesAreaByIdCache)),
     _mapper);
        public void Add(IEnumerable <ISRSettings> items)
        {
            if (items == null)
            {
                throw new ArgumentNullException(nameof(items));
            }

            var entities = _mapper
                           .Map <IEnumerable <ISRSettingsEntity> >(items, opts => opts.UseEntityCache(_salesAreaByNameCache))
                           .ToArray();

            _dbContext.AddRange(entities,
                                x => x.MapToCollection(items, opts => opts.UseEntityCache(_salesAreaByIdCache)), _mapper);
        }
        public void AddRange(IEnumerable <ScenarioCampaignFailure> scenarioCampaignFailures, bool setIdentity = true)
        {
            var entities = _mapper.Map <ScenarioCampaignFailureEntity[]>(scenarioCampaignFailures);

            if (setIdentity)
            {
                _dbContext.AddRange(
                    entities,
                    post => post.MapToCollection(scenarioCampaignFailures),
                    _mapper
                    );
            }
            else
            {
                _dbContext.BulkInsertEngine.BulkInsert(
                    entities,
                    new BulkInsertOptions()
                {
                    BatchSize = 400000, BulkCopyTimeout = 300
                }
                    );
            }
        }
Beispiel #6
0
        public void AddOrUpdate(ScenarioCampaignMetric scenarioCampaignMetrics)
        {
            List <ScenarioCampaignMetricEntity> externalEntities = _mapper.Map <List <ScenarioCampaignMetricEntity> >(scenarioCampaignMetrics);

            List <ScenarioCampaignMetricEntity> entities = _dbContext.Query <ScenarioCampaignMetricEntity>()
                                                           .Where(e => e.ScenarioId == scenarioCampaignMetrics.Id)
                                                           .ToList();

            if (!entities.Any())
            {
                _dbContext.BulkInsertEngine.BulkInsert(externalEntities, new BulkInsertOptions()
                {
                    BatchSize = 600000
                });
            }
            else
            {
                var addedEntities   = externalEntities.Where(x => !entities.Contains(x)).ToArray();
                var deletedEntities = entities.Where(x => !externalEntities.Contains(x)).ToArray();

                _dbContext.RemoveRange(deletedEntities);
                _dbContext.AddRange(addedEntities);
            }
        }
Beispiel #7
0
 public void AddRange(IEnumerable <StandardDayPartGroup> dayPartGroups) =>
 _dbContext.AddRange(_mapper.Map <StandardDayPartGroupEntity[]>(dayPartGroups,
                                                                opts => opts.UseEntityCache(_salesAreaByNameCache)),
                     post => post.MapToCollection(dayPartGroups,
                                                  opts => opts.UseEntityCache(_salesAreaByIdCache)),
                     _mapper);
Beispiel #8
0
 public void AddRange(params KPIPriority[] models) =>
 _dbContext.AddRange(_mapper.Map <KPIPriorityEntity[]>(models), post => post.MapToCollection(models), _mapper);
Beispiel #9
0
 public void AddRange(IEnumerable <BookingPositionGroup> bookingPositionGroups) =>
 _dbContext.AddRange(_mapper.Map <BookingPositionGroupEntity[]>(bookingPositionGroups),
                     post => post.MapToCollection(bookingPositionGroups), _mapper);
Beispiel #10
0
 public void AddRange(IEnumerable <EmailAuditEventSettings> items) =>
 _dbContext.AddRange(_mapper.Map <EmailAuditEventSettingsEntity[]>(items),
                     post => post.MapToCollection(items), _mapper);
Beispiel #11
0
 public void Insert(List <MSTeamsAuditEventSettings> items) =>
 _dbContext.AddRange(_mapper.Map <MSTeamsAuditEventSettingsEntity[]>(items),
                     post => post.MapToCollection(items), _mapper);
 public void AddRange(IEnumerable <ProgrammeCategoryHierarchy> programmeCategories) =>
 _dbContext.AddRange(_mapper.Map <Entities.Tenant.ProgrammeCategoryHierarchy[]>(programmeCategories),
                     post => post.MapToCollection(programmeCategories), _mapper);
Beispiel #13
0
 public void Add(IEnumerable <Demographic> channels) =>
 _dbContext.AddRange(_mapper.Map <Entities.Tenant.Demographic[]>(channels));
 public void AddRange(IEnumerable <LengthFactor> items) =>
 _dbContext.AddRange(_mapper.Map <Entities.Tenant.LengthFactor[]>(items, opts => opts.UseEntityCache(_salesAreaByNameCache)),
                     post => post.MapToCollection(items, opts => opts.UseEntityCache(_salesAreaByIdCache)), _mapper);
Beispiel #15
0
 public void AddRange(IEnumerable <SalesAreaDemographic> entities) =>
 _dbContext.AddRange(_mapper.Map <Entities.Tenant.SalesAreas.SalesAreaDemographic[]>(entities, opts => opts.UseEntityCache(_salesAreaByNameCache)),
                     post => post.MapToCollection(entities, opts => opts.UseEntityCache(_salesAreaByIdCache)), _mapper);
 public void AddRange(params ProgrammeCategoryHierarchy[] models)
 {
     _dbContext.AddRange(_mapper
                         .Map <List <ProgrammeCategoryHierarchyEntity> >(models).ToArray());
 }
Beispiel #17
0
 public void Add(IEnumerable <RSSettings> rsSettings) =>
 _dbContext.AddRange(_mapper.Map <RSSettingsEntity[]>(rsSettings, opts => opts.UseEntityCache(_salesAreaByNameCache)),
                     post => post.MapToCollection(rsSettings, opts => opts.UseEntityCache(_salesAreaByIdCache)), _mapper);
Beispiel #18
0
 public void AddRange(IEnumerable <InventoryLock> inventoryLocks) =>
 _dbContext.AddRange(_mapper.Map <Entities.Tenant.InventoryStatuses.InventoryLock[]>(inventoryLocks, opts => opts.UseEntityCache(_salesAreaByNameCache)),
                     post => post.MapToCollection(inventoryLocks, opts => opts.UseEntityCache(_salesAreaByIdCache)), _mapper);
Beispiel #19
0
 public void AddRange(params BRSConfigurationTemplate[] models) =>
 _dbContext.AddRange(_mapper.Map <BRSConfigurationTemplateEntity[]>(models), post => post.MapToCollection(models), _mapper);
Beispiel #20
0
 public void AddRange(IEnumerable <TotalRating> totalRatings) =>
 _dbContext.AddRange(_mapper.Map <TotalRatingEntity[]>(totalRatings, opts => opts.UseEntityCache(_salesAreaByNameCache)),
                     post => post.MapToCollection(totalRatings, opts => opts.UseEntityCache(_salesAreaByIdCache)), _mapper);
Beispiel #21
0
 public void AddRange(params KPIComparisonConfig[] models) =>
 _dbContext.AddRange(_mapper.Map <KPIComparisonConfigEntity[]>(models), post => post.MapToCollection(models), _mapper);
Beispiel #22
0
 public void Add(IEnumerable <SmoothFailureMessage> items)
 {
     _dbContext.AddRange(_mapper.Map <IEnumerable <SmoothFailureMessageEntity> >(items).ToArray(),
                         post => post.MapToCollection(items), _mapper);
 }
Beispiel #23
0
 public void AddRange(IEnumerable <InventoryLockType> lockTypes) =>
 _dbContext.AddRange(_mapper.Map <Entities.Tenant.InventoryStatuses.InventoryLockType[]>(lockTypes),
                     post => post.MapToCollection(lockTypes), _mapper);
Beispiel #24
0
 public void AddRange(params BusinessType[] models) =>
 _dbContext.AddRange(_mapper.Map <BusinessTypeEntity[]>(models), post => post.MapToCollection(models), _mapper);