2
我不是LINQ的最大用戶,但我試圖檢索ModuleAvailabilities
,其中academicYear
是當前年份。增強此LINQ查詢的可讀性和性能?
這裏有什麼改進嗎?
pathway.PathwayFoundationModule.Attach(
pathway.PathwayFoundationModule.CreateSourceQuery()
.Include("Module")
.Include("Module.ModuleAvailabilities.Location")
.Where(o => o.Module.ModuleAvailabilities
.Where(x => x.AcademicYear == academicYear.Current)
.Count() >= 0)
);
你是說當'.Count之間的()> = 0',是不是總是> = 0? – 2010-07-22 16:36:52