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

LoadReadOnlyQuestions() public method

Loads the completed questions for a given completed section.
public LoadReadOnlyQuestions ( int responseHeaderId, int sectionId ) : IQueryable
responseHeaderId int The ID of the of the completed survey.
sectionId int The ID of the section.
return IQueryable
        public IQueryable<ReadonlyQuestion> LoadReadOnlyQuestions(int responseHeaderId, int sectionId)
        {
            var questions = (from response in this.Context.Responses
                             where response.ResponseHeaderId == responseHeaderId && response.SectionId == sectionId
                             select new ReadonlyQuestion
                                        {
                                            QuestionId = response.QuestionId,
                                            Text = response.QuestionText,
                                            Comments = response.Comments,
                                            RelativeOrder = response.QuestionRelativeOrder,
                                            ControlType = response.ControlType,
                                            SectionId = response.SectionId,
                                            ResponseHeaderId = response.ResponseHeaderId
                                        })
                             .Distinct()
                             .OrderBy(response => response.RelativeOrder);

            return questions;
        }