- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
for (var attempt = 0; attempt < 3; attempt++)
{
var result = (from neighborhood in this.DataContext.Neighborhoods
join city in this.DataContext.Cities on neighborhood.CityId equals city.Id
where !string.IsNullOrEmpty(neighborhood.Latitude) && (neighborhood.Id <= 31028 || attempt == 2) &&
(attempt == 0 && !string.IsNullOrEmpty(location.city) ? (city.Name.Equals(location.city, StringComparison.InvariantCultureIgnoreCase)) : true)
select new...).ToList();
}
Follow us!