Esempio n. 1
0
        public async Task <ActionResult <IpAddressDetails> > GetIpAddressDetails(long id)
        {
            try
            {
                var ipAddressDetails = await _ipAddressService.GetGeoLocationDataById(id);

                if (ipAddressDetails == null)
                {
                    return(NotFound());
                }

                return(Ok(_mapper.Map <IpAddressDetailsDto>(ipAddressDetails)));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }