Пример #1
0
        public async Task <ActionResult <IEnumerable <PictureViewModel> > > GetAllByUser()
        {
            var userId = User.Claims.ElementAt(0).Value;

            var pictures = await _service.GetAllByUserIdAsync(userId);

            if (!pictures.Any())
            {
                return(NotFound());
            }

            return(Ok(_mapper.Map <IEnumerable <PictureViewModel> >(pictures)));
        }