使用LinqPad这个工具可以很快学习并掌握linq[Language Integrated Query]
linqPad官方下载地址:http://www.linqpad.net/
linqPad4百度云下载(for .NET Framework4.0/4.5):链接:http://pan.baidu.com/s/1gflmRDp 密码:3n3f
linqPad5百度云下载(for .NET Framework 4.6):链接:http://pan.baidu.com/s/1dE5Z0VB 密码:qpgc
LINQPad is not just for LINQ queries, but any C#/F#/VB expression, statement block or program. Put an end to those hundreds of Visual Studio Console projects cluttering your source folder and join the revolution of LINQPad scripters and incremental developers.
Reference your own assemblies and NuGet packages. Prototype your ideas in LINQPad and then paste working code into Visual Studio. Or call your scripts directly from the command-line.
Experience LINQPad’s rich output formatting, optional debugger and autocompletion, and the magic of dynamic development and instant feedback!
。
!
先在数据库创建一个数据库MyFirstEF 和CustomerInfo和OrderInfo两张表
create database MyFirstEF on primary ( name='MyFirstEF.mdf', --修改为自己电脑上SQL DB路径 filename='E:\ProgramMSSQLServerDB\MyFirstEF.mdf', size=5mb, maxsize=100mb, filegrowth=10% ) log on ( name='MyFirstEF_log.ldf', --修改为自己电脑上SQL DB路径 filename='E:\ProgramMSSQLServerDB\MyFirstEF_log.ldf', size=2mb, maxsize=100mb, filegrowth=5mb ) go use MyFirstEF go create table CustomerInfo ( id int identity(1,1) primary key, customerName nvarchar(100) not null, customerDate datetime ) go create table OrderInfo ( id int identity(1,1) primary key, orderName nvarchar(100), customerId int ) go insert into CustomerInfo select 'aa',GETDATE() union all select 'bb',GETDATE() union all select 'cc',GETDATE() union all select 'dd',GETDATE() go insert into OrderInfo select 'bike1',2 union all select 'bike2',2 union all select 'car1',3 union all select 'car2',3 union all select 'chezi1',4 union all select 'chezi2',4 union all select 'test1',5 union all select 'test2',5 go select * from CustomerInfo go select * from OrderInfo go