public void UpdateProduct(ProductDTO productDTO) { Product product = new Product(); ProductConvertor.ConvertToProductEntity(ref product, productDTO, true); UnitOfWork unitOfWork = new UnitOfWork(); unitOfWork.ProductRepository.Update(product); unitOfWork.SaveChanges(); }
public void AddProduct(ProductDTO productDTO) { Product product = new Product(); ProductConvertor.ConvertToProductEntity(ref product, productDTO, false); UnitOfWork unitOfWork = new UnitOfWork(); unitOfWork.ProductRepository.Add(product); unitOfWork.SaveChanges(); }