select a.stakebuyinid , a.StakeBuyInValue from StakeBuyInByStakeCategories AS b
left join StakeBuyIns AS a on b.stakebuyinid = a.stakebuyinid
where b.GametypeId = 1 and b.StakeCategoryID = 3 and a.Currencyid = 1
以上是我簡單的SQL查詢我想在LINQ寫作留在LINQ連接查詢
寫我使用下面的LINQ查詢,但引發錯誤: - 「演員價值型‘的Int32’失敗,因爲物化值爲null。結果類型的泛型參數或查詢必須使用可空類型。「
var query = (from v in db.StakeBuyInByStakeCategories.Where(x => x.GameTypeId == gametypeid && x.StakeCategoryId == stakecategoryid)
join u in db.StakeBuyIns.Where(y => y.CurrencyId == currencyid)
on v.StakeBuyInId equals u.StakeBuyInId into Temp
from vus in Temp.DefaultIfEmpty()
select new {
vus.StakeBuyInId,
vus.StakeBuyInValue)
好的。你嘗試了什麼,問題在哪裏? – Artless 2013-05-05 05:31:00
我編輯我的問題 – ujjaval 2013-05-05 05:46:21