public async Task <IActionResult> Get(string shortUrl) { var id = Shortener.Decode(shortUrl); if (id == -1) { return(NotFound()); } var mapping = await dbContext.Urls.FindAsync(id); if (mapping == null) { return(NotFound()); } return(new RedirectResult(mapping.Url)); }