2014-06-19 24 views
-1
public dynamic ogretimUyesiGetir2(int enstituKodu, int anabilimDaliKodu) 
{ 
    var liste = (from p in en.OgretimUyeleri 
       join j in en.AnaBilimDallari on 
       new { p.EnstituKodu, p.AnaBilimDaliKodu } 
       equals new { EnstituKodu = j.EnstituKodu, AnaBilimDaliKodu = anabilimDaliKodu } 
       select new 
       { 
        p.EnstituKodu, 
        p.AnaBilimDaliKodu, 
        Adı = p.Adi, 
        SoyAdı = p.Soyadi, 
        AnaBilimDaliAdi = j.AnaBilimDaliAdi 
       }).Where(p => p.EnstituKodu == enstituKodu &&         
           p.AnaBilimDaliKodu == anabilimDaliKodu).ToList(); 

    return liste; 
} 

錯誤:聯接子句中的類型的表達式之一是不正確

The type of one of the expressions in the join clause is incorrect. Type inference failed in the call to 'Join'.

幫助我嗎?

+0

使用英語設計變量和方法名稱。你的代碼應該做什麼?請添加相關類定義 –

回答

0

如果您在equals new代碼更改爲以下一個

equals new { EnstituKodu = enstituKodu, AnaBilimDaliKodu = anabilimDaliKodu } 

它會奏效。

+0

問題仍在繼續。 :( – user3755626

+0

是否收到相同的錯誤信息? – Christos

+0

是的,錯誤:連接子句中某個表達式的類型不正確 – user3755626

相關問題