Example #1
0
        public BaseResponse <TaskWithAnswerResponse> InfoWithAnswer(int taskId)
        {
            var task = _dbContext.Tasks.FirstOrDefault(x => x.Id == taskId);

            if (task == null)
            {
                return(BaseResponse <TaskWithAnswerResponse> .Fail(_errorMessageProvider.TaskNotFound));
            }

            return(BaseResponse <TaskWithAnswerResponse> .Success(
                       _mefMapper.Map <Entities.Task, TaskWithAnswerResponse>(task)));
        }
Example #2
0
        public BaseResponse <CompanyResponse> Info(int companyId)
        {
            var companyResponse = _dbContext.Companies.FirstOrDefault(x => x.Id == companyId);

            if (companyResponse == null)
            {
                return(BaseResponse <CompanyResponse> .Fail(_errorMessageProvider.CompanyNotFound));
            }

            return(BaseResponse <CompanyResponse> .Success(_mefMapper.Map <Company, CompanyResponse>(companyResponse)));
        }
Example #3
0
        public BaseResponse <ChallangeResponse> Info(int challangeId)
        {
            var challange = _dbContext.Challanges.FirstOrDefault(x => x.Id == challangeId);

            if (challange == null)
            {
                return(BaseResponse <ChallangeResponse> .Fail(_errorMessageProvider.ChallangeNotFound));
            }

            return(BaseResponse <ChallangeResponse> .Success(_mefMapper.Map <Challange, ChallangeResponse>(challange)));
        }
Example #4
0
        public BaseResponse <TeamResponse> Info(int teamId)
        {
            var team = _dbContext.Teams.FirstOrDefault(x => x.Id == teamId);

            if (team == null)
            {
                return(BaseResponse <TeamResponse> .Fail(_errorMessageProvider.TaskNotFound));
            }

            return(BaseResponse <TeamResponse> .Success(_mefMapper.Map <Team, TeamResponse>(team)));
        }