public object CreateProduct(ProductReq req) { Product product = new Product(); product.ProductID = req.ProductID; product.ProductName = req.ProductName; product.Price = req.Price; product.BrandID = req.BrandID; product.CategoryID = req.CategoryID; product.CreateDate = req.CreateDate; product.Unit = req.Unit; product.UnitsInStock = req.UnitsInStock; product.Discount = req.Discount; product.Description = req.Description; product.Picture = req.Picture; product.Description = req.Note; return(productRep.Create(product)); }
public object CreateProduct(ProductReq req) { //Khởi tạo giá trị Product product = new Product(); //Gán giá trị product.ProductId = req.ProductId; product.Name = req.Name; product.Price = req.Price; product.BrandId = req.BrandId; product.CategoryId = req.CategoryId; product.Unit = req.Unit; product.UnitsInStock = req.UnitsInStock; product.Discount = req.Discount; product.UnitsInStock = req.UnitsInStock; product.Description = req.Description; product.CreatedDate = req.CreatedDate; product.Note = req.Note; product.Picture = req.Picture; //Tạo giá trị và trả về return(_rep.Create(product)); }