Example #1
0
        public IActionResult GetAggregatedAnswersByForm(string form)
        {
            var survey = aggregationService.GetChartData(form);

            if (survey == null)
            {
                return(NotFound());
            }

            return(Ok(survey));
        }
Example #2
0
        public async Task UpdateDashboard(SurveyData surveyData)
        {
            using (var client = new HttpClient())
            {
                client.BaseAddress = new Uri("https://survey-dashboards.azurewebsites.net");
                var content = new StringContent(JsonConvert.SerializeObject(aggregationService.GetChartData(surveyData.FormName), new JsonSerializerSettings {
                    ContractResolver = new CamelCasePropertyNamesContractResolver()
                }), Encoding.UTF8, "application/json");
                var result = await client.PostAsync("/questionnaire/", content);

                string resultContent = await result.Content.ReadAsStringAsync();
            }
        }