コード例 #1
0
        public void Add(RatingsPredictionSchedule item)
        {
            if (item == null)
            {
                throw new ArgumentNullException(nameof(item));
            }

            var entity = _dbContext.Find <PredictionSchedule>(new object[] { item.Id },
                                                              find => find.IncludeCollection(pb => pb.Ratings));

            if (entity == null)
            {
                _ = _dbContext.Add(
                    _mapper.Map <PredictionSchedule>(item, opts => opts.UseEntityCache(_salesAreaByNameCache)),
                    post => post.MapTo(item, mappingOptions => mappingOptions.UseEntityCache(_salesAreaByIdCache)), _mapper);
            }
            else
            {
                _ = _mapper.Map(item, entity, opts => opts.UseEntityCache(_salesAreaByNameCache));
                _ = _dbContext.Update(entity, post => post.MapTo(item, mappingOptions => mappingOptions.UseEntityCache(_salesAreaByIdCache)), _mapper);
            }
        }
コード例 #2
0
 public SmoothFailureMessage Add(SmoothFailureMessage model)
 {
     _ = _dbContext.Add(_mapper.Map <SmoothFailureMessageEntity>(model), post => post.MapTo(model), _mapper);
     return(model);
 }
コード例 #3
0
 public TenantProductFeature Add(TenantProductFeature model)
 {
     _ = _dbContext.Add(_mapper.Map <TenantProductFeatureEntity>(model), post => post.MapTo(model), _mapper);
     return(model);
 }
コード例 #4
0
 public ProgrammeDictionary Add(ProgrammeDictionary model)
 {
     _ = _dbContext.Add(_mapper.Map <ProgrammeDictionaryEntity>(model), post => post.MapTo(model), _mapper);
     return(model);
 }
コード例 #5
0
 public BookingPosition Add(BookingPosition model)
 {
     _ = _dbContext.Add(_mapper.Map <BookingPositionEntity>(model), post => post.MapTo(model), _mapper);
     return(model);
 }
コード例 #6
0
 public Universe Add(Universe model)
 {
     _ = _dbContext.Add(_mapper.Map <UniverseEntity>(model), post => post.MapTo(model), _mapper);
     return(model);
 }
コード例 #7
0
 public Demographic Add(Demographic model)
 {
     _ = _dbContext.Add(_mapper.Map <DemographicEntity>(model), post => post.MapTo(model), _mapper);
     return(model);
 }
コード例 #8
0
 public ProgrammeClassification Add(ProgrammeClassification model)
 {
     _ = _dbContext.Add(_mapper.Map <ProgrammeClassificationEntity>(model), post => post.MapTo(model), _mapper);
     return(model);
 }
コード例 #9
0
 public EfficiencySettings Add(EfficiencySettings model)
 {
     _ = _dbContext.Add(_mapper.Map <EfficiencySettingsEntity>(model), post => post.MapTo(model), _mapper);
     return(model);
 }