這裏,我寫的代碼功能,我儘快得到錯誤,我增加了行調用第二個功能是ValidCodes = GetValidCodes(bv.Variable_Id)
錯誤同時呼籲從LINQ查詢
public IQueryable<BvIndexRow> GetBenefitVariableIndex(int healthPlanId)
{
var q = from bv in Db.BenefitVariables
where bv.Private == "N" || (bv.Private == "Y" && bv.Health_Plan_ID == healthPlanId)
join bao in Db.baObject on bv.Variable_Id equals bao.ba_Object_id
join servicetype in Db.BenefitVariableServiceTypes.Where(bvst => bvst.Key_Service_Type == "Y" && bvst.isActive == 1)
on bv.Variable_Id equals servicetype.Variable_Id into groupedBvst
where bv.isActive == 1 && bao.isActive == 1
from bvst in groupedBvst.DefaultIfEmpty()
select new BvIndexRow
{
// some code here too
ValidCodes = GetValidCodes(bv.Variable_Id)
};
return q;
}
public string GetValidCodes(int varID)
{
// some code here
return "None";
}
你得到了什麼錯誤?你能否以更具可讀性的格式重新發布代碼,刪除與該問題無關的行? –
我不知道爲什麼我得到了我的問題投票。請你們理解並給予及時的迴應。 – Rajesh
@NetDev我不確定你爲什麼要這麼做,我今天已經投票了很多,並且處於我的極限,但我會盡力消除別人的莽撞。我認爲這是由於格式化(你已經修復)。你在問一個問題,該問題涉及到一個很容易被新手忽略的LINQ-to-SQL的基本部分。當然,我認爲它很有用! – Kevek