Exemplo n.º 1
0
        public List <UrlDetails> RetrieveUrlDetails(string shortenUrl)
        {
            string[] urlArray = shortenUrl.Split("/");
            shortenUrl = urlArray[1];
            ulong  id             = _conversion.Decode(shortenUrl);
            string urlDetailsJson = _storage
                                    .GetValueFromHash(Constants.ShortenUrlDetailTable, shortenUrl);
            List <UrlDetails> urldetails = JsonConvert
                                           .DeserializeObject <List <UrlDetails> >(urlDetailsJson);

            return(urldetails);
        }
Exemplo n.º 2
0
        public string ShortToLongUrl(string shortenUrl)
        {
            ulong id = _conversion.Decode(shortenUrl);

            return(_storage.GetValueFromHash(Constants.UrlTable, id.ToString()));
        }