2011-07-19 40 views
0

有誰知道是否有工具將T-SQL代碼轉換爲LINQ? 我努力尋找下面的SQL代碼轉換爲LINQ的方式:使用組內部連接轉換爲LINQ

select * from actions as a 
inner join 
(
    select max(actionid) as maxactionid, threaduid from actions as a 
    where a.actiontypeid not in (3,4) 
    group by threaduid 
) as a2 on a2.maxactionid = a.actionid 
where a.userid <> 2 

任何幫助表示讚賞!

+0

重複的http://stackoverflow.com/questions/296972/sql-to-linq-tool – Peter

回答

3
+0

偉大的工具,雖然我認爲如果我有耐心,我可以自己做到這一點;)我不得不將查詢拆分爲2並獨立翻譯每個查詢,然後在工具抱怨錯誤時將它們連接起來。 – jaffa

0

有一個從http://www.sqltolinq.com/ linqer。

Linqer是SQL到LINQ轉換工具。它可以幫助您學習LINQ並轉換您現有的SQL語句。