Ejemplo n.º 1
0
        public bool Update(Dto.Model.Product.ProductDTO entity)
        {
            Product update = rep.Context.Set <Product>().FirstOrDefault(x => x.ProductId == entity.ProductId);

            update.ProductId    = entity.ProductId;
            update.ProductName  = entity.ProductName;
            update.UnitPrice    = entity.UnitPrice;
            update.UnitsInStock = entity.UnitsInStock;
            return(rep.Update());
        }
Ejemplo n.º 2
0
        public bool Add(Dto.Model.Product.ProductDTO entity)
        {
            Product product = new Product
            {
                ProductId    = entity.ProductId,
                ProductName  = entity.ProductName,
                UnitPrice    = entity.UnitPrice,
                UnitsInStock = entity.UnitsInStock
            };

            return(rep.Add(product));
        }
Ejemplo n.º 3
0
        public bool Delete(Dto.Model.Product.ProductDTO entity)
        {
            Product delete = rep.GetOne(entity.ProductId);

            return(rep.Delete(delete));
        }