This section describes a linqpad tool used for LINQ operations and testing. I feel that this tool is very good, not only in terms of functionality, but also in use.
Linqpad official address: http://www.linqpad.net/
There are two running Modes on the right side of the page. One is integration into an executable program mode, and the other is installation mode.
Here is an example. Description.
The interface can be roughly divided into four separate PANES:
(1) The upper left part of the connection is used to connect to the data source that can be made of LINQ. There are many data source types. By adding a connection, you can see that you can add linqtosql or the WCF Service, it can also be another data source.
(2) The upper right part is the query window, which is the part of code writing. You can select a language or a database. Similar to the database query analyzer.
In the language list, select:
Take the data in the MERs table as an example.
(1) C # expression
Used for linqsql Query
From C in customers select C
(2) C # statement
Used for C # statement Query
VaR P = from C in customers select C;
P. Dump ();
Dump can display the query results.
(3) C # Program
Used to support methods and types of queries. The main method must be defined.
Void main ()
{
VaR P = from C in customers select C;
P. Dump ();
}
(4) SQL
Traditional SQL queries
Select * from customer
In the first three methods, the table name of the database table to be queried is set to + S in the connection window by default. note this in linqpad.
(5) esql and VB are ignored.
(3) Some teaching examples and saved queries are shown in the lower left part.
Some parameters of linqpad can be set here, or some examples can be used here.
(4) the bottom right part is the query result window.
There are four tabs. You can view the results, SQL, and IL.
The statement mode (C # statement) is recommended for use ).