public void Save(IEnumerable <FlatOffer> offers)
        {
            _dbContext.FixStateOfEntitiesWithoutKey(offers.SelectMany(x => x.Notifications));
            _dbContext.FixStateOfEntitiesWithoutKey(offers.SelectMany(x => x.Links));
            _dbContext.FixStateOfEntitiesWithoutKey(offers.Where(x => x.Images != null).SelectMany(x => x.Images));

            _dbContext.FlatOffers.UpdateRange(offers);
            _dbContext.SaveChanges();
        }
예제 #2
0
        public void CreateExecutionRecord(DateTime dateTimeStarted, DateTime dateTimeFinished, bool success)
        {
            Context.Execution.Add(new Entities.ExecutionRecord
            {
                DateTimeStarted  = dateTimeStarted,
                DateTimeFinished = dateTimeFinished,
                Success          = success
            });

            Context.SaveChanges();
        }
 public void Save(ExecutionRecord record)
 {
     _dbContext.Add(record);
     _dbContext.SaveChanges();
 }
예제 #4
0
        public void Save(IEnumerable <Notification> notifications)
        {
            _dbContext.Notifications.UpdateRange(notifications);

            _dbContext.SaveChanges();
        }