public IActionResult GetAggregatedAnswersByForm(string form) { var survey = aggregationService.GetChartData(form); if (survey == null) { return(NotFound()); } return(Ok(survey)); }
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(); } }