Пример #1
0
        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();
        }
Пример #2
0
        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();
        }