Skip to content

Instantly share code, notes, and snippets.

@JeremyLikness
Created August 22, 2017 19:31
Show Gist options
  • Select an option

  • Save JeremyLikness/6e3dbd74d9575bd8bf4cee85026dba46 to your computer and use it in GitHub Desktop.

Select an option

Save JeremyLikness/6e3dbd74d9575bd8bf4cee85026dba46 to your computer and use it in GitHub Desktop.
Querying tables in Sterling
var combos = db.Query<Combo, int>()
.Where(c => c.LazyValue.Value.Color.Id == colorList[idx].Id) // filter
.Select(c => c.LazyValue.Value); // project to lazy-loaded value
var comboList = combos.Select(c => $"{c.Color.Name} {c.Planet.Name} {c.Cat.Name}");
foreach(var combo in comboList.OrderBy(c => c))
{
Console.WriteLine($"Found awesome combo {combo}.");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment