Last active
October 20, 2018 16:17
-
-
Save zulander1/6997e43aa9528f2c9abe20931ce11677 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 query = (from o in dbcontext.Orders | |
let lastStatus = dbcontext.OrderStatus.Where(x => x.OrderId == o.Id).OrderByDescending(x => x.CreatedDate).FirstOrDefault() | |
where lastStatus.OrderId != 1 | |
select new { o.Name, lastStatus.Id } | |
).ToList(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output