コード例 #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);
        }
コード例 #2
0
 public void Add(MetadataModel metadata)
 {
     _dbContext.RemoveRange(_dbContext.Query <MetadataCategory>().ToArray());
     if (metadata.Any())
     {
         _dbContext.AddRange(_mapper.Map <IEnumerable <MetadataCategory> >(metadata).ToArray());
     }
 }
コード例 #3
0
ファイル: PassRepository.cs プロジェクト: Morebis-GIT/CI
 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);
コード例 #4
0
        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);
        }
コード例 #5
0
        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
                }
                    );
            }
        }
コード例 #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);
            }
        }
コード例 #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);
コード例 #8
0
 public void AddRange(params KPIPriority[] models) =>
 _dbContext.AddRange(_mapper.Map <KPIPriorityEntity[]>(models), post => post.MapToCollection(models), _mapper);
コード例 #9
0
 public void AddRange(IEnumerable <BookingPositionGroup> bookingPositionGroups) =>
 _dbContext.AddRange(_mapper.Map <BookingPositionGroupEntity[]>(bookingPositionGroups),
                     post => post.MapToCollection(bookingPositionGroups), _mapper);
コード例 #10
0
 public void AddRange(IEnumerable <EmailAuditEventSettings> items) =>
 _dbContext.AddRange(_mapper.Map <EmailAuditEventSettingsEntity[]>(items),
                     post => post.MapToCollection(items), _mapper);
コード例 #11
0
 public void Insert(List <MSTeamsAuditEventSettings> items) =>
 _dbContext.AddRange(_mapper.Map <MSTeamsAuditEventSettingsEntity[]>(items),
                     post => post.MapToCollection(items), _mapper);
コード例 #12
0
 public void AddRange(IEnumerable <ProgrammeCategoryHierarchy> programmeCategories) =>
 _dbContext.AddRange(_mapper.Map <Entities.Tenant.ProgrammeCategoryHierarchy[]>(programmeCategories),
                     post => post.MapToCollection(programmeCategories), _mapper);
コード例 #13
0
 public void Add(IEnumerable <Demographic> channels) =>
 _dbContext.AddRange(_mapper.Map <Entities.Tenant.Demographic[]>(channels));
コード例 #14
0
 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);
コード例 #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);
コード例 #16
0
 public void AddRange(params ProgrammeCategoryHierarchy[] models)
 {
     _dbContext.AddRange(_mapper
                         .Map <List <ProgrammeCategoryHierarchyEntity> >(models).ToArray());
 }
コード例 #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);
コード例 #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);
コード例 #19
0
 public void AddRange(params BRSConfigurationTemplate[] models) =>
 _dbContext.AddRange(_mapper.Map <BRSConfigurationTemplateEntity[]>(models), post => post.MapToCollection(models), _mapper);
コード例 #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);
コード例 #21
0
 public void AddRange(params KPIComparisonConfig[] models) =>
 _dbContext.AddRange(_mapper.Map <KPIComparisonConfigEntity[]>(models), post => post.MapToCollection(models), _mapper);
コード例 #22
0
 public void Add(IEnumerable <SmoothFailureMessage> items)
 {
     _dbContext.AddRange(_mapper.Map <IEnumerable <SmoothFailureMessageEntity> >(items).ToArray(),
                         post => post.MapToCollection(items), _mapper);
 }
コード例 #23
0
ファイル: LockTypeRepository.cs プロジェクト: Morebis-GIT/CI
 public void AddRange(IEnumerable <InventoryLockType> lockTypes) =>
 _dbContext.AddRange(_mapper.Map <Entities.Tenant.InventoryStatuses.InventoryLockType[]>(lockTypes),
                     post => post.MapToCollection(lockTypes), _mapper);
コード例 #24
0
 public void AddRange(params BusinessType[] models) =>
 _dbContext.AddRange(_mapper.Map <BusinessTypeEntity[]>(models), post => post.MapToCollection(models), _mapper);