Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var countriesElse = db.Profiles
- .GroupBy(av => av.Country)
- .Select(g => new { Country = g.Key, Count = g.Count() });
- var otherCount = countriesElse
- .Where(x => x.Country != "US" && x.Country != "CA").FirstOrDefault();
- ViewBag.otherCount = otherCount.Count;
- if(otherCount != null)
- ViewBag.otherCount = otherCount.Count;
- else ViewBag.otherCount = 0;
- var profile = db.Profiles
- .GroupBy(av => av.Country)
- .Select(g => new { Country = g.Key, Count = g.Count() })
- .FirstOrDefault(x => x.Country != "US" && x.Country != "CA");
- ViewBag.otherCount = profile== null ? 0 : profile.Count;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement