-3
加入我有一個LINQ查詢作爲LINQ到SQL查詢錯誤使用時有多個條件
from elements in context.Catalog_Element
join elementattributevalues in context.Catalog_ElementAttributeValue
on elements.ElementID equals elementattributevalues.ElementID
join allowedsubcomponents in context.Catalog_AllowedSubComponents
on new { AttributeValueID = elementattributevalues.AttributeValueID,
ElementClassID = elements.ElementClassID }
equals new { AttributeValueID = allowedsubcomponents.AttributeValueIDFilter,
ElementClassID = allowedsubcomponents.ClassIDFilter }
where allowedsubcomponents.ElementID ==
new Guid("8c139311-f7cd-4961-a8bb-0d8dd923049e")
select new
{
elements.ElementNumber,
elements.Description
})
這是我展示了語法錯誤作爲一個表達式的加入子句中的類型不正確。請幫忙。
這似乎不是有效的編譯的C#代碼。請糾正它。也請解釋你正在嘗試做什麼? Catalog_Element代表什麼?什麼是ElementAttributeValues? – Arran
更正了代碼,我試圖獲取數據三個表catalog_element,catalog_elementAttributevalue,&catalog_allowedsubcomponents。 catalog_element是一個表,其中Elementattribute值是catalog_elementAttributevalue的別名。我已經檢查過匿名類型和數據類型,並且第二次連接的語法仍然顯示錯誤 –