public ViewResult ShortenUrl(ShortenUrlViewModel request) { if (!request.Url.Contains(":")) { request.Url = @"http://" + request.Url; } var urlId = service.CreateUrlIdentifier(request.Url); var shortUrl = Request.Url.Scheme + @"://" + Request.Url.Authority + @"/" + urlId; request.ShortenedUrl = shortUrl; return(View(request)); }