Emmmanuel FIADUFE

Emmmanuel FIADUFE

  • 793
  • 1.1k
  • 53.6k

The value of OrderId keep showing zero on the console panel

Jun 19 2023 1:29 PM

Hello Team,

Please the value of  my OrderId keep showing zero on the console panel when I click on update query, kindly assist.thank you

 
        public ActionResult getNewOrder()
        {
            using (db = new ASPNETMASTERPOSTEntities())
            {
                var dataList = db.tblCustomers.Include("tblOrders");
                var modifiedData = dataList.AsEnumerable().SelectMany(x => x.tblOrders.Select(d => new OrderViewModel
                {
                    CustomerId = x.CustomerId,
                    CustomerName = d.tblCustomer.CustomerName,
                    PhoneNo = d.tblCustomer.PhoneNo,
                    OrderDate = d.tblCustomer.OrderDate,
                    CategoryName = d.CategoryName,
                    ProductName = d.ProductName,
                    Quantity = d.Quantity,
                    UnitPrice = d.UnitPrice,
                    TotalAmount = d.TotalAmount,
                    OrderId = d.OrderId
                })).ToList();
                return Json(modifiedData, JsonRequestBehavior.AllowGet);
            }
        }


Answers (3)