0

Does anyone know if there is a tool to convert T-SQL code to LINQ? I'm struggling to find a way of converting the following SQL code to 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

Any help appreciated!

jaffa
  • 26,770
  • 50
  • 178
  • 289

2 Answers2

3

check out: http://www.sqltolinq.com/

Chris Klepeis
  • 9,783
  • 16
  • 83
  • 149
dknaack
  • 60,192
  • 27
  • 155
  • 202
  • Great tool, although I think I could have worked it out myself if I'd had the patience;) I had to split the query into 2 and translate each query independently then join them up as the tool complained of an error. – jaffa Jul 20 '11 at 08:47
0

There is linqer from http://www.sqltolinq.com/.

Linqer is a SQL to LINQ converter tool. It helps you to learn LINQ and convert your existing SQL statements.

Mangesh
  • 3,987
  • 2
  • 31
  • 52