public void Add(Scenario scenario) { var entity = _mapper.Map <ScenarioEntity>(scenario); ApplyPassesOrder(entity.PassReferences); _dbContext.Add( entity, post => post.MapTo(scenario), _mapper); }
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); } }