public void QueryCaseReportSections()
        {
            var results = _aspergillosisContext.CaseReportFormSections
                          .Include(crfs => crfs.CaseReportFormResultFields)
                          .ToList <dynamic>();

            foreach (CaseReportFormSection result in results)
            {
                var viewModel = new CaseReportFormSectionViewModel();
                viewModel.Name       = result.Name;
                viewModel.ID         = result.ID;
                viewModel.FieldNames = result.CaseReportFormResultFields.Select(crfrf => crfrf.Label).ToList();
                _list.Add(viewModel);
            }
        }
        public async Task <IActionResult> Create(CaseReportFormSectionViewModel formSectionVM)
        {
            if (ModelState.IsValid)
            {
                CaseReportFormSectionViewModel.BuildSection(_context, formSectionVM);
                await _context.SaveChangesAsync();

                return(Json(new { result = "ok" }));
            }
            else
            {
                Hashtable errors = ModelStateHelper.Errors(ModelState);
                return(Json(new { success = false, errors }));
            }
        }