/// <summary> /// Create an address based on the model property values. /// </summary> /// <param name="properties"></param> /// <returns></returns> private string GetAddress1(GModel.PropertyModel properties) { var address = new StringBuilder(); if (!String.IsNullOrWhiteSpace($"{ properties.CivicNumber}")) { address.Append($"{properties.CivicNumber} "); } if (properties.IsStreetTypePrefix && !String.IsNullOrWhiteSpace(properties.StreetType)) { address.Append($"{properties.StreetType} "); } if (properties.IsStreetDirectionPrefix && !String.IsNullOrWhiteSpace(properties.StreetDirection)) { address.Append($"{properties.StreetDirection} "); } if (!String.IsNullOrWhiteSpace(properties.StreetName)) { address.Append(properties.StreetName); } if (!String.IsNullOrWhiteSpace(properties.StreetQualifier)) { address.Append($" {properties.StreetQualifier}"); } if (!properties.IsStreetDirectionPrefix && !String.IsNullOrWhiteSpace(properties.StreetDirection)) { address.Append($" {properties.StreetDirection}"); } if (!properties.IsStreetTypePrefix && !String.IsNullOrWhiteSpace(properties.StreetType)) { address.Append($" {properties.StreetType}"); } return(address.ToString()); }
/// <summary> /// Get the administrative area name (city, municipality, district, etc.) based on the model property values. /// </summary> /// <param name="properties"></param> /// <returns></returns> private string GetAdministrativeArea(GModel.PropertyModel properties) { return(properties.LocalityName); }
/// <summary> /// Get the city name based on the model property values. /// </summary> /// <param name="properties"></param> /// <returns></returns> private string GetCity(GModel.PropertyModel properties) { return(properties.LocalityType == "City" ? properties.LocalityName : null); }