namespace HaWeb.Models; public class SucheViewModel { public List<(int Year, List LetterList)>? Letters { get; private set; } public int Count { get; private set; } public int ActiveYear { get; private set; } public List<(int StartYear, int EndYear)>? AvailableYears { get; private set; } public string? ActivePerson {get; set; } public List<(string Key, string Name)>? AvailablePersons { get; private set; } public SucheViewModel(List<(int Year, List LetterList)>? letters, int activeYear, List<(int StartYear, int EndYear)>? availableYears, List<(string Key, string Name)>? availablePersons) { Letters = letters; if (letters != null) Count = letters.Select(x => x.LetterList.Count).Aggregate(0, (x, y) => { x += y; return x; }); else Count = 0; ActiveYear = activeYear; AvailableYears = availableYears; AvailablePersons = availablePersons; } }