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);
}
}
Vishal JoshiPosted Jun 20, 2023, 5:28 AM
Hello Emma,
Please review the below points:
Check the below code Make sure the OrderId is mapped properly and retrieving proper table data.
Thanks
Emmmanuel FIADUFEPosted Jun 20, 2023, 11:26 AM
Thank you team for your swift response, it is working now
Rajkiran SwainPosted Jun 19, 2023, 2:40 PM