예제 #1
0
        public void Add(Scenario scenario)
        {
            var entity = _mapper.Map <ScenarioEntity>(scenario);

            ApplyPassesOrder(entity.PassReferences);

            _dbContext.Add(
                entity,
                post => post.MapTo(scenario),
                _mapper);
        }
예제 #2
0
        public void Update(Scenario scenario)
        {
            var entity = GetScenarioQueryWithAllIncludes().FirstOrDefault(e => e.Id == scenario.Id);

            if (entity != null)
            {
                _mapper.Map(scenario, entity);
                ApplyPassesOrder(entity.PassReferences);

                _dbContext.Update(entity, post => post.MapTo(scenario), _mapper);
            }
        }