BoxKite.Twitter.PlacesGeoExtensions.GetPlaceSimilarName C# (CSharp) Метод

GetPlaceSimilarName() публичный статический Метод

Locates places near the given coordinates which are similar in name. NOTE: The token contained in the response is the token needed to be able to create a new place.
ref: https://dev.twitter.com/docs/api/1.1/get/geo/similar_places
public static GetPlaceSimilarName ( this session, string name = "", double latitude = 0.0, double longitude = 0.0, string containedWithin = "" ) : Task
session this
name string The name a place is known as.
latitude double The latitude to search around
longitude double The longitude to search around
containedWithin string This is the place_id which you would like to restrict the search results to. Setting this value means only places within the given place_id will be found.
Результат Task
        public static async Task<ReverseGeoCodePlaces> GetPlaceSimilarName(this IUserSession session,
            string name = "", double latitude = 0.0,
            double longitude = 0.0, string containedWithin = "")
        {
            var parameters = new TwitterParametersCollection
                             {
                                 {"lat", latitude.ToString()},
                                 {"long", longitude.ToString()},
                                 {"name",name}
                             };
            if (!string.IsNullOrWhiteSpace(containedWithin))
            {
                parameters.Add("contained_within", containedWithin);
            }

            return await session.GetAsync(TwitterApi.Resolve("/1.1/geo/similar_places.json"), parameters)
                .ContinueWith(c => c.MapToSingle<ReverseGeoCodePlaces>());
        }