예제 #1
0
        public async Task <ShortUrlEntity> CreateShortUrl(ShortUrlRequest shortUrlRequest)
        {
            var result = await _urlSecuredService.CreateShortUrl(shortUrlRequest);

            result.ShortUrl.Replace(_configuration.GetSection("ActualDomain").Value, _configuration.GetSection("Domain").Value);
            return(result);
        }
예제 #2
0
        public async Task <ShortUrlList> CreateShortUrl(ShortUrlRequest shortUrlRequest)
        {
            CancellationToken cancellationToken = new CancellationToken();

            var response = await _client.PostAsJsonAsync($"/api/UrlShortener", shortUrlRequest, cancellationToken);

            var resultList = await response.Content.ReadAsStringAsync();

            return(JsonConvert.DeserializeObject <ShortUrlList>(resultList));
        }
예제 #3
0
        public async Task <ShortUrlList> CreateShortUrl(ShortUrlRequest shortUrlRequest)
        {
            var result = await _urlSecuredService.CreateShortUrl(shortUrlRequest);

            return(result);
        }