Created
August 7, 2013 00:42
-
-
Save jordansjones/6170262 to your computer and use it in GitHub Desktop.
Linq to Rest API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Service Client doesn't make the call until we attempt to enumerate the results (.ToList()) | |
var serviceClient = new UsersServiceClient(); | |
List<User> disabledUsers = serviceClient.Get().Where(user => user.IsDisabled).ToList(); | |
// Or a more complex example | |
var serviceClient = new IssuesServiceClient(); | |
var query = serviceClient.Get() | |
// At this point the query hasn't run | |
query = from issue in query | |
where State == "open" | |
&& Milestone > 1 | |
orderby Created ASC; | |
// Now run the query | |
IEnumerable<Issue> issues = await (query.Skip(10)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't get the point of this. Won't you be issuing a request for all records for this to work?