Exemplo n.º 1
0
        //Update

        public void Update(ProductBTO existingCateg)
        {
            UnitOfWork unitOfWork = new UnitOfWork(context);

            unitOfWork.ProductRepo.Update(existingCateg.ProductBTOToProduct());
            unitOfWork.Save();
        }
Exemplo n.º 2
0
        //Create
        public ProductBTO Create(ProductBTO bto)
        {
            UnitOfWork unitOfWork = new UnitOfWork(context);
            var        response   = unitOfWork.ProductRepo.Create(bto.ProductBTOToProduct());

            unitOfWork.Save();
            return(response.ProductToProductBTO());



            //using (ProductRepo repo = new ProductRepo(context))
            //{
            //    //De la Logique...

            //    repo.Create(bto.ProductBTOToProduct());
            //}

            //return bto;
        }