How to declare variables and use statements in LINQPad?
Do you know how to declare variables in LINQPad in order to hold the query result and use it 开发者_开发知识库later in multiply queries?
Thanks!
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.
精彩评论