Ejemplo n.º 1
0
        private static IEnumerable <PharmacyMedicamentLink> FilterByRangeInternal(
            this IEnumerable <PharmacyMedicamentLink> links, RequestAggregateSettings settings)
        {
            var clientCoordinates = new GeoCoordinate(settings.Latitude, settings.Longitude);

            foreach (var link in links)
            {
                if (link.Pharmacy.GetDistanceTo(clientCoordinates) <= settings.SearchRadius)
                {
                    yield return(link);
                }
            }
        }
Ejemplo n.º 2
0
 public static IEnumerable <PharmacyMedicamentLink> FilterByRange(this IEnumerable <PharmacyMedicamentLink> links, RequestAggregateSettings settings)
 {
     return(settings.UseSearchRadius ? links.FilterByRangeInternal(settings) : links);
 }