-
Notifications
You must be signed in to change notification settings - Fork 0
/
6-4 Take and Skip.linq
34 lines (30 loc) · 1.48 KB
/
6-4 Take and Skip.linq
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<Query Kind="Statements">
<Connection>
<ID>b5bf0f26-eb4d-481f-aab0-d1d516538992</ID>
<Persist>true</Persist>
<Server>.\SQLEXPRESS</Server>
<AttachFile>true</AttachFile>
<UserInstance>true</UserInstance>
<AttachFileName>L:\Downloads\northwind\NORTHWND.mdf</AttachFileName>
</Connection>
<Reference Relative="..\RxBookLinqpadHelper\ext\System.Reactive.dll">D:\ProgrammingRx\Demo Code For Chapters\RxBookLinqpadHelper\ext\System.Reactive.dll</Reference>
<Reference Relative="..\RxBookLinqpadHelper\ext\Microsoft.Reactive.Testing.dll">D:\ProgrammingRx\Demo Code For Chapters\RxBookLinqpadHelper\ext\Microsoft.Reactive.Testing.dll</Reference>
<Reference Relative="..\RxBookLinqpadHelper\RxBookLinqpadHelper\bin\Debug\RxBookLinqpadHelper.dll">D:\ProgrammingRx\Demo Code For Chapters\RxBookLinqpadHelper\RxBookLinqpadHelper\bin\Debug\RxBookLinqpadHelper.dll</Reference>
<Namespace>System.Reactive</Namespace>
<Namespace>System.Reactive.Linq</Namespace>
<Namespace>Microsoft.Reactive.Testing</Namespace>
<Namespace>RxBookLinqpadHelper</Namespace>
<Namespace>System.Reactive.Concurrency</Namespace>
</Query>
DataContext dataContext = this;
var query = from Contact in dataContext.GetTable<Contacts>()
where Contact.City == "London"
select new
{
Contact.ContactID,
Contact.CompanyName,
Contact.ContactName
};
var afterSkipping = query.Skip(2);
var takingTwo = afterSkipping.Take(2);
takingTwo.Dump();