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

DeleteReadOnlySurvey() public method

Deletes the specified completed survey ResponseHeader and responses.
public DeleteReadOnlySurvey ( int responseHeaderId ) : void
responseHeaderId int The ID
return void
        public void DeleteReadOnlySurvey(int? responseHeaderId)
        {
            var responseHeader = (from rh in this.Context.ResponseHeaders
                                  where rh.ResponseHeaderId == responseHeaderId
                                  select rh).Single();

            this.Context.ResponseHeaders.DeleteOnSubmit(responseHeader);
            this.Context.Responses.DeleteAllOnSubmit(responseHeader.Responses);

            this.Context.SubmitChanges();
        }