0
我有以下代碼:無效Linq查詢哪裏
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);
}
我想獲得訂單明細的行,其中外鍵的OrderId等於參數的orderId。但是我不斷收到以下錯誤:Error 2 Cannot implicitly convert type 'int' to 'bool'
。我錯過了什麼?
難以置信的..謝謝。 :-) – Seth
@Seth,因爲這是正確的答案,您應該將其標記爲答案。 – m4tt1mus