Linqer–Convert SQL statements to LINQ
LINQPad, the most popular LINQ tool out there , does not convert SQL statements into their equivalent LINQ syntax. However, a free tool called Linqer does just that. Linqer takes an SQL expression and turns it into a LINQ query.
There were a few confusing steps in setting up the tool.
- Basically, it needs to have a datasource set up. It needs this in the form of an ado.net connection string (the same string you would use in an app.config or a web.config file). Setting up the datasource was a bit tricky – since it insisted on generating DBML files before it would accept the ado.net datasource. Once you provide it with a path to place the dbml file – it happily configures the datasource for use.
- Linqer will generate the DBML (LinqtoSQL mapping files) for you.
- Now, you are ready to INPUT your sql statements – and see their equivalent LINQ statements as the output (as shown below).
Leave a Reply