Exemple #1
0
        public IActionResult GetFromId(int genreId)
        {
            var genre = _repository.GetFromId(genreId);

            GenreResponse response = GenreResponse.MapFromObject(genre);

            return(Ok(response));
        }
Exemple #2
0
        public IActionResult GetImplementedByUser()
        {
            var userId = TokenManager.ExtractUserId(User.Claims);
            var genres = _repository.GetByUser(userId);

            List <GenreResponse> response = new List <GenreResponse>();

            foreach (var genre in genres)
            {
                response.Add(GenreResponse.MapFromObject(genre));
            }

            return(Ok(response));
        }