コード例 #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);
        }