public List<RetornoLocalizacaoTotem> GetLocTotemSvc(string end) { List<RetornoLocalizacaoTotem> lstRetorno = new List<RetornoLocalizacaoTotem>(); string[] lstend = end.Split(';'); foreach (string loc in lstend) { string[] separador = loc.Split('_'); string endereco = separador[0]; string titulo = separador[1]; string codigo = separador[2]; GeoRequest request = new GeoRequest(endereco + ", São Paulo"); GeoResponse response = request.GetResponse(); foreach (GeoResult item in response.Results) { RetornoLocalizacaoTotem local = new RetornoLocalizacaoTotem(); GeoLocation location = item.Geometry.Location; local.CodigoNo = codigo; local.Endereco = titulo; local.Latitude = location.Latitude; local.Longitude = location.Longitude; local.EnderecoCompleto = item.FormattedAddress; lstRetorno.Add(local); } } return lstRetorno; }
public IActionResult ASN(GeoRequest request) { if (!ModelState.IsValid) { return(ApiResponse <string> .ValidationError(request.IP)); } var asn = maxmindService.ASN(request.IP); return(new ApiResponse <AsnResponse>() { Payload = asn }); }
public IActionResult Country(GeoRequest request) { if (!ModelState.IsValid) { return(ApiResponse <string> .ValidationError(request.IP)); } var country = maxmindService.Country(request.IP); return(new ApiResponse <CountryResponse>() { Payload = country }); }
public static void Main(string[] args) { var y = new GeoRequest(address); y.Ge }