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); }
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); }
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); }