我必須加入多個表。這些表格對於每個表格都有類似的數據。LINQ奇怪的加入表
ID
(table id for FK)
Name
Description
Owner
from d in Departments
join f in Functions on d.DepartmentID equals f.DepartmentID
join pg in Processes on f.FunctionID equals pg.FunctionID
select new { d.DepartmentID, f.Name, pg.Name }
這將引發錯誤「匿名類型不能有多個同名的屬性」
有沒有更好的方式加入這些表?我可以做Select new { d, f, pg }
嗎?從那裏獲取數據很容易嗎?
我對LINQ很陌生,所以任何幫助表示讚賞。