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);
            }
        }
 public SmoothFailureMessage Add(SmoothFailureMessage model)
 {
     _ = _dbContext.Add(_mapper.Map <SmoothFailureMessageEntity>(model), post => post.MapTo(model), _mapper);
     return(model);
 }
 public TenantProductFeature Add(TenantProductFeature model)
 {
     _ = _dbContext.Add(_mapper.Map <TenantProductFeatureEntity>(model), post => post.MapTo(model), _mapper);
     return(model);
 }
Esempio n. 4
0
 public ProgrammeDictionary Add(ProgrammeDictionary model)
 {
     _ = _dbContext.Add(_mapper.Map <ProgrammeDictionaryEntity>(model), post => post.MapTo(model), _mapper);
     return(model);
 }
 public BookingPosition Add(BookingPosition model)
 {
     _ = _dbContext.Add(_mapper.Map <BookingPositionEntity>(model), post => post.MapTo(model), _mapper);
     return(model);
 }
 public Universe Add(Universe model)
 {
     _ = _dbContext.Add(_mapper.Map <UniverseEntity>(model), post => post.MapTo(model), _mapper);
     return(model);
 }
 public Demographic Add(Demographic model)
 {
     _ = _dbContext.Add(_mapper.Map <DemographicEntity>(model), post => post.MapTo(model), _mapper);
     return(model);
 }
Esempio n. 8
0
 public ProgrammeClassification Add(ProgrammeClassification model)
 {
     _ = _dbContext.Add(_mapper.Map <ProgrammeClassificationEntity>(model), post => post.MapTo(model), _mapper);
     return(model);
 }
Esempio n. 9
0
 public EfficiencySettings Add(EfficiencySettings model)
 {
     _ = _dbContext.Add(_mapper.Map <EfficiencySettingsEntity>(model), post => post.MapTo(model), _mapper);
     return(model);
 }