Last active
January 3, 2016 12:39
-
-
Save lnickers2004/8464658 to your computer and use it in GitHub Desktop.
LINQ: sample queries collected over time...
This file contains hidden or 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
//001: RAVEN DB LINQ QUERY | |
var results = session.Query<Car>() | |
.Statistics(out stats) | |
.Skip(0*10) // retrieve results for the first page | |
.Take(20) // page size is 20 | |
.Where(x => x.Make == "Ford") | |
.Distinct().ToList(); | |
//002: descending orderby | |
var query = this._unit.Homes.GetAll().OrderByDescending(s => s.Price); | |
vm.Homes = query.ToList(); | |
//003: repository all method query NOTE: repo returned an IQueryable | |
// var allEvents = eventdataRepository.All.ToList();//Store.GetAll(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment