示例#1
0
        /// <summary>
        /// Get's Picture Location by Longitiude and Latitude and saves the pictures to the Database
        /// </summary>
        /// <param name="longitude">Location Longitude</param>
        /// <param name="latitude">Location Latitude</param>
        /// <param name="page">Use this for Paging</param>
        /// <returns></returns>
        public async Task <Result> GetLocationByLonLat(string longitude, string latitude, int?page)
        {
            Result result = await _searchRequest.GetPhotosforLocationAsync(latitude, longitude, page.Value);

            Place place = await _searchRequest.GetLocationByLonLat(latitude, longitude);

            HostingEnvironment.QueueBackgroundWorkItem(ct => SavePictures(result, place));

            #region   TODO:// Implement Mef with HangFire
            //BackgroundJob.Enqueue(() => SavePictures(result, place));
            #endregion


            return(result);
        }