Пример #1
0
        public void DeleteSave(ProductBO productBO)
        {
            var product = mapper.Map <Product>(productBO);

            unitOfWork.Products.Delete(product.Id);
            unitOfWork.Products.Save();
        }
Пример #2
0
        public void Save(ProductBO productBO)
        {
            var product = mapper.Map <Product>(productBO);

            if (productBO.Id == 0)
            {
                Add(product);
            }
            else
            {
                Update(product);
            }
            unitOfWork.Products.Save();
        }