// geohash.org public string GetPathAsGeoHash() { TrackingContext context = new TrackingContext(); var locations = context.Trackings .Where(t => t.ValidGPS) .Select(t => t.Location) .ToList(); var path = locations.Select(l => GeoHash.Encode(l.Latitude, l.Longitude)); return(string.Join(",", path)); }
// geohash.org public string GetPathAsGeoHash() { IList <string> path = new List <string>(); using (var context = new TrackingContext()) { var locations = context.Trackings.Where(t => t.ValidGPS).Select(t => t.Location).ToList(); foreach (Location location in locations) { path.Add(GeoHash.Encode(location.Latitude, location.Longitude)); } return(string.Join(",", path)); } }
public DbTrackingRepository(TrackingContext context) { this.context = context; }
public LocationRepository(TrackingContext context) { this.context = context; }