Last active
August 16, 2017 15:53
-
-
Save cphillips83/2f24e7631b6c49834c2a2a5664ac7d80 to your computer and use it in GitHub Desktop.
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
{ | |
var q0 = dc.Contacts | |
.Where(x => x.ID > 1 && x.Status == EntityStatus.Active) | |
.OrderByDescending(x => x.ID) | |
.Select(x => new { x.ID, x.Status }); | |
var c0 = q0.FirstOrDefault(); | |
Console.WriteLine(c0); | |
} | |
{ | |
var q1 = from x in dc.Contacts | |
where x.ID > 1 && x.Status == EntityStatus.Active | |
orderby x.ID descending | |
select new { x.ID, x.Status }; | |
var c1 = q1.FirstOrDefault(); | |
Console.WriteLine(c1); | |
} | |
{ | |
var q2 = from x in dc.Contacts | |
where x.ID > 1 && x.Status == EntityStatus.Active | |
orderby x.ID descending | |
select x; | |
var c2 = q2.FirstOrDefault(); | |
Console.WriteLine(c2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment