コード例 #1
0
        public IActionResult GoToMapping(string path)
        {
            var mapped = _urlService.Get(path);

            if (mapped != null)
            {
                return(new RedirectResult(mapped.ToString()));
            }
            return(NotFound());
        }
コード例 #2
0
        public async Task <IActionResult> Get(string shortGuid)
        {
            try
            {
                var result = await urlService.Get(shortGuid);

                return(Ok(result));
            }
            catch (Exception e)
            {
                return(ExceptionResult(e));
            }
        }
コード例 #3
0
        public async Task <IActionResult> Get(string shortGuid)
        {
            var result = await urlService.Get(shortGuid);

            return(Ok(result));
        }