Reputation: 8373
I have the following code:
public ActionResult Details(int orderId)
{
var query = from orderDetails in storeDb.OrderDetails
where orderDetails.OrderId = orderId
select new { orderDetails.Product, orderDetails.Quantity, orderDetails.UnitPrice };
return View(query);
}
I want to get the rows of orderDetails where the foreign key OrderId is equal to the parameter orderId. However I keep getting the following error: Error 2 Cannot implicitly convert type 'int' to 'bool'
. What am I missing?
Upvotes: 0
Views: 162
Reputation: 20332
where orderDetails.OrderId = orderId
Needs to be
where orderDetails.OrderId == orderId
Upvotes: 8