Example #1
0
        public async Task <IActionResult> GetLocations(string userName)
        {
            var      final = new Hashtable();
            Location loc;

            int[]           ConfUsers = LocationData.GetConfirmedUserId(userName);
            List <Location> arr       = new List <Location>();

            foreach (int userId in ConfUsers)
            {
                loc = await FetchUserLocation(userId);

                if (loc != null)
                {
                    arr.Add(new Location()
                    {
                        Username = loc.Username, Lat = loc.Lat, Lon = loc.Lon
                    });
                }
            }
            final.Add("friends", arr);
            return(Json(final));
        }