Пример #1
0
        public async Task <ActionResult> Get()
        {
            if (!HttpContext.Request.Cookies.TryGetValue("userId", out var userId))
            {
                return(Ok());
            }

            var links = await _linkService.GetLinks(userId);

            return(Ok(
                       links.Select(l =>
                                    new GetAllLinksResult
            {
                ShortLink = l.ShortLink,
                OriginalLink = l.OriginalLink,
                HitCount = l.HitCount
            })));
        }