Пример #1
0
        public async Task <IActionResult> GetShortenUrl(ShortenUrlInput input)
        {
            //add fluent validation
            if (!ModelState.IsValid)
            {
                return(BadRequest(new ApiExceptionResponse("Invalid Input")));
            }
            var response = await _service.ShortenURL(_mapper.Map <ShortenUrlInput, UrlInfo>(input));

            return(Ok(response));
        }