public Dictionary<Guid, AnswersSummary> Get(Guid surveyId) { var survey = this.surveyRepository.Get(surveyId); if (survey == null) { throw this.WebException(HttpStatusCode.NotFound); } var submissionSummaryService = new SubmissionSummaryService(this.surveyRepository); var summary = submissionSummaryService.GetSubmissionsSummary(surveyId); return summary; }
public object GetService(Type serviceType) { var repository = new SurveyRepository(); if (serviceType == typeof(SurveyController)) { return new SurveyController(repository); } else if (serviceType == typeof(SurveySubmissionController)) { var submissionSummaryService = new SubmissionSummaryService(repository); return new SurveySubmissionController(repository, submissionSummaryService); } return null; }