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

LoadReadOnlySections() public method

Loads the completed sections for a given completed survey.
public LoadReadOnlySections ( int responseHeaderId, int surveyId ) : IQueryable
responseHeaderId int The ID of the of the completed survey.
surveyId int The ID of the survey.
return IQueryable
        public IQueryable<ReadonlySection> LoadReadOnlySections(int responseHeaderId, int surveyId)
        {
            return (from response in this.Context.Responses
                    where response.ResponseHeaderId == responseHeaderId && response.SurveyId == surveyId
                    select new ReadonlySection
                               {
                                   SurveyId = response.SurveyId,
                                   SectionId = response.SectionId,
                                   Text = response.SectionText,
                                   ShowText = response.ShowSectionText,
                                   RelativeOrder = response.SectionRelativeOrder,
                                   ResponseHeaderId = response.ResponseHeaderId
                               })
                    .Distinct()
                    .OrderBy(response => response.RelativeOrder);
        }