Esempio n. 1
0
        public async Task <ActionResponseDTO> GetList()
        {
            ActionResponseWrapper actionResponseWrapper = new ActionResponseWrapper(typeof(ChallengeApp).FullName);

            //Gets the challenges in the database
            IList <Challenge> foundChallenges = await challengeInfrastructure.GetList();

            //Translates
            IList <ChallengeDTO> challengesDTO = ChallengeTranslator.SetDTO(foundChallenges);

            //Prepares the return
            actionResponseWrapper.SetContent(challengesDTO);

            return(actionResponseWrapper.Value);
        }
Esempio n. 2
0
        public ActionResponseDTO List()
        {
            ActionResponseWrapper actionResponseWrapper = new ActionResponseWrapper(typeof(WriterApp).FullName);

            //Gets the list in the database
            IList <Writer> writerList = writerInfrastructure.List();

            //Translates
            IList <WriterDTO> writerListDTO = WriterTranslator.SetDTO(writerList);

            //Prepares the return
            actionResponseWrapper.SetContent(writerListDTO);

            return(actionResponseWrapper.Value);
        }
Esempio n. 3
0
        public async Task <ActionResponseDTO> GetById(int id)
        {
            ActionResponseWrapper actionResponseWrapper = new ActionResponseWrapper(typeof(ChallengeApp).FullName);

            //Gets the challenge in the database
            Challenge foundChallenge = await challengeInfrastructure.GetById(id);

            //Translates
            ChallengeDTO challengeDTO = ChallengeTranslator.SetDTO(foundChallenge);

            //Prepares the return
            actionResponseWrapper.SetContent(challengeDTO);

            return(actionResponseWrapper.Value);
        }