コード例 #1
0
        public void Create(CreateProductionDTO model)
        {
            Production dbModel = _mapper.Map <Production>(model);

            _service.Production.Create(dbModel);
            _service.Commit();
        }
コード例 #2
0
        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();
        }