Want more features on Pastebin? Sign Up, it's FREE!
Guest

http://stackoverflow.com/questions/10203191

By: a guest on Apr 19th, 2012  |  syntax: C#  |  size: 0.31 KB  |  views: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. var data =
  2. from country in db.GetTable<Country>().Where(c=>c.Allowed)
  3. let totalTeams = country.Teams.Count()
  4. let teamsWithoutOwner = country.Teams.Count(t=>t.OwnerId != 0)
  5. select new CountryTeamsInfo
  6. {
  7.     CountryId = country.Id,
  8.     TeamsTotal = totalTeams,
  9.     TeamsWithoutOwnerFree = teamsWithoutOwnerFree
  10. };
clone this paste RAW Paste Data