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.

  1. 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.
  2. Linqer will generate the DBML (LinqtoSQL mapping files) for you.
  3. Now, you are ready to INPUT your sql statements – and see their equivalent LINQ statements as the output (as shown below).

 

linqer2

Anuj holds professional certifications in Google Cloud, AWS as well as certifications in Docker and App Performance Tools such as New Relic. He specializes in Cloud Security, Data Encryption and Container Technologies.

Initial Consultation

Anuj Varma – who has written posts on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.