@using System.Text.RegularExpressions @using System.Globalization; @model LecturesViewModel @{ ViewData["Title"] = "Vorlesungsplan"; string GetBranchName(string branch) { Regex regex = new Regex(@".* - (.*)"); var match = regex.Match(branch); if (match.Success) { return match.Groups[1].Value; } else { return branch; } } } @section Header {
}
@foreach (var time in Model.LectureEvents.GroupBy(x => x.From).OrderBy(x => x.Key)) { string timeId = time.Key.ToString("HHmm"); string timeHeader = $"header-{timeId}"; string timeCollapse = $"collapse-{timeId}"; string timeAccordion = $"accordion-{timeId}";

@foreach (var eventItem in time.Distinct().OrderBy(x => x.Lecture.Title)) { string eventId = $"{timeId}-{eventItem.Id}"; string eventHeader = $"header-{eventId}"; string eventCollapse = $"collapse-{eventId}";

Zeitraum: -
Ort:
@eventItem.Location
@eventItem.Lecture.Url
}
}