Esempio n. 1
0
        public async Task <ActionResult <ICollection <ElementGetDto> > > Get(bool?isFinished, string phrase = "")
        {
            var user = await _userRepository.GetById(AuthUserId);

            if (user == null)
            {
                return(Unauthorized());
            }

            var elements = await _elementRepository.GetForUser(AuthUserId, phrase, isFinished);

            var elementsDto = _mapper.Map <ICollection <ElementGetDto> >(elements);

            return(Ok(elementsDto));
        }