@model QuestionnaireViewModel @{ ViewData["Title"] = "Delete Questionnaire"; var totalAnswers = Model.Questions?.Sum(q => q.Answers?.Count ?? 0) ?? 0; var otherCount = Model.Questions?.Count(q => q.Answers != null && q.Answers.Any(a => a.IsOtherOption)) ?? 0; var qCount = Model.Questions?.Count ?? 0; }
This will permanently remove all @qCount questions and @totalAnswers answers