Do you know how to declare variables in LINQPad in order to hold the query result and use it later in multiply queries?
Thanks!
For each query, LINQPad creates a separate server, which a class that runs in its own process and executes the query in isolation. This isolation prevents queries from interfering with each other (or the UI) and allows LINQPad to safely cancel a query without polluting other application domains.
Click on "Add connection"; a window will appear. Choose "Default (LINQ to SQL)" and click on the "Next" button. A new window will appear, fill in the required details to get connected with the desired database.
LINQPad is a software utility targeted at . NET Framework and . NET Core development. It is used to interactively query SQL databases (among other data sources such as OData or WCF Data Services) using LINQ, as well as interactively writing C# code without the need for an IDE.
Just select C# or VB Statements, and you will be able to write variable declarations.
To view the content of your variables, you can use the Dump extension method available on all types:
var test = "Test String";
test.Dump(); // the content is shown in the output
Or you can use the Console.Write
method.
If you want to include method or class declarations within a LinqPad file, select C# or VB Program.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With