예제 #1
0
        private MainContent ComposeMainContent(MainContent baseMainContent, List <DateTime> entries, Language language)
        {
            var mainContent = baseMainContent.Clone();
            var links       = new HashSet <Link>();

            entries.ForEach(entry =>
            {
                var link = new Link()
                {
                    Text = entry.ToString("MMMM yyyy", new CultureInfo(language.GetDescription())),
                    Url  = $"{entry.Year}{entry.Month.ToString("00")}"
                };
                links.Add(link);
            });

            mainContent.MenuContent = new MenuContent()
            {
                Title = "History",
                Links = links.OrderByDescending(_ => _.Url).ToList()
            };
            return(mainContent);
        }