Exemplo n.º 1
0
        public IActionResult InsertProductADO([FromBody] ProdInsertReq req)
        {
            var res  = new SingleRsp();
            var hist = _svc.InsertProductADO(req);

            res.Data = hist;
            return(Ok(res));
        }
Exemplo n.º 2
0
        //Câu 3 đề 5 thêm record cho bảng Products bằng LINQ
        public SingleRsp InsertProductLINQ(ProdInsertReq req)
        {
            Products prod = new Products();

            prod.ProductName     = req.ProductName;
            prod.SupplierId      = req.SupplierId;
            prod.CategoryId      = req.CategoryId;
            prod.QuantityPerUnit = req.QuantityPerUnit;
            prod.UnitPrice       = req.UnitPrice;
            prod.UnitsInStock    = req.UnitsInStock;
            prod.UnitsOnOrder    = req.UnitsOnOrder;
            prod.ReorderLevel    = req.ReorderLevel;
            prod.Discontinued    = req.Discontinued;
            return(_rep.InsertProductLINQ(prod));
        }