public void Create(CreateProductionDTO model) { Production dbModel = _mapper.Map <Production>(model); _service.Production.Create(dbModel); _service.Commit(); }
public void Edit(CreateProductionDTO model) { var dbModel = _service.Production.GetProduction(model.Id); if (dbModel == null) { throw new Exception("object not found"); } _mapper.Map <CreateProductionDTO, Production>(model, dbModel); _service.Production.Update(dbModel); _service.Commit(); }