Engage.Survey.Entities.SurveyRepository.LoadReadOnlyQuestion C# (CSharp) Method

LoadReadOnlyQuestion() public method

Loads the given completed question.
public LoadReadOnlyQuestion ( int responseHeaderId, int questionId ) : IQuestion
responseHeaderId int The ID of the of the completed survey.
questionId int The ID of the question.
return IQuestion
        public IQuestion LoadReadOnlyQuestion(int responseHeaderId, int questionId)
        {
            return (from response in this.Context.Responses
                    where response.ResponseHeaderId == responseHeaderId && response.QuestionId == questionId
                    select new ReadonlyQuestion
                               {
                                       QuestionId = response.QuestionId,
                                       Text = response.QuestionText,
                                       Comments = response.Comments,
                                       RelativeOrder = response.QuestionRelativeOrder,
                                       ControlType = response.ControlType,
                                       SectionId = response.SectionId,
                                       ResponseHeaderId = response.ResponseHeaderId
                               }).FirstOrDefault();
        }