LINQPad is a justly popular tool for trying out LINQ queries — it’s a great way to quickly check how a query will behave or just to check what’s in your database. (Actually, it’s a great way to test quick code snippets whether LINQy or otherwise.) LINQPad version 2 has just shipped, and in addition to the familiar LINQ to SQL support, it allows you to plug in other LINQ providers — such as LightSpeed.
We’re pleased to announce the immediate availability of a LightSpeed driver for LINQPad. This means you’ll be able to test LightSpeed queries using your LightSpeed domain model with all the speed and convenience of LINQPad.
And of course, because the driver uses LightSpeed, you’ll be able to use all the facilities of LightSpeed — for example, to perform Lucene-based full-text search from within LINQPad, or to include or exclude soft-deleted entities from the query.
To get the LightSpeed driver, just go into LINQPad, click Add Connection in the data sources list, choose View more drivers…, and choose the LightSpeed driver from the list. LINQPad will automatically download and install it. Once this is done, you’ll see LightSpeed in the Add Connection dialog. Select LightSpeed and click Next.
Now all you need to do is configure the connection with details of your database and the assembly containing your LightSpeed model. You’ll need to tell LINQPad the following details:
To save time, you can also use the Infer from Model button to extract this configuration information from your .lsmodel file. (You’ll still need to have built the DLL or EXE though.)
You can also set up LightSpeed context properties such as whether table names in the database are pluralised and whether to quote identifiers in queries. If you’re planning to use LINQPad to do ad hoc inserts and updates, you can also specify the identity method and timestamp strategy.
That’s it! You’re ready to get querying!
(If you have any trouble with the automatic download of the LightSpeed driver, you can instead download it directly from Mindscape here and install it using the Browse button on the “Choose a Driver” screen.)
You can get LINQPad here. And if you don’t already have LightSpeed, you can get the free Express edition here. And if there are any more features you’d like to see in the driver, let us know in the LightSpeed forum!