<commit_before>using System.Linq;
using System.Threading.Tasks;
using Lombiq.TrainingDemo.Indexes;
using Lombiq.TrainingDemo.Models;
using Microsoft.AspNetCore.Mvc;
using OrchardCore.ContentManagement;
using OrchardCore.ContentManagement.Display;
using OrchardCore.DisplayManagement.ModelBinding;
using OrchardCore.Modules;
using YesSql;

namespace Lombiq.TrainingDemo.Controllers
{
    public class PersonListController : Controller, IUpdateModel
    {
        private readonly ISession _session;
        private readonly IClock _clock;
        private readonly IContentItemDisplayManager _contentItemDisplayManager;
        private readonly IContentManager _contentManager;


        public PersonListController(
            ISession session,
            IClock clock,
            IContentItemDisplayManager contentItemDisplayManager,
            IContentManager contentManager)
        {
            _session = session;
            _clock = clock;
            _contentItemDisplayManager = contentItemDisplayManager;
            _contentManager = contentManager;
        }


        public async Task<ActionResult> OlderThan30()
        {
            var thresholdDate = _clock.UtcNow.AddYears(-30);
            var people = await _session
                .Query<ContentItem, PersonPartIndex>(index => index.BirthDateUtc < thresholdDate)
                .ListAsync();

            var shapes = await Task.WhenAll(people.Select(async person =>
                await _contentItemDisplayManager.BuildDisplayAsync(person, this, "Summary")));

            // Testing 1..2..3...

            var person1 = await _contentManager.NewAsync("Person");
            var personPart1 = person1.As<PersonPart>();
            personPart1.Name = "Person 1";

            var person2 = await _contentManager.NewAsync("Person");
            var personPart2 = person2.As<PersonPart>();
            personPart2.Name = "Person 2";


            return View(shapes);
        }
    }
}<commit_msg>Removing test code<commit_after>using System.Linq;
using System.Threading.Tasks;
using Lombiq.TrainingDemo.Indexes;
using Microsoft.AspNetCore.Mvc;
using OrchardCore.ContentManagement;
using OrchardCore.ContentManagement.Display;
using OrchardCore.DisplayManagement.ModelBinding;
using OrchardCore.Modules;
using YesSql;

namespace Lombiq.TrainingDemo.Controllers
{
    public class PersonListController : Controller, IUpdateModel
    {
        private readonly ISession _session;
        private readonly IClock _clock;
        private readonly IContentItemDisplayManager _contentItemDisplayManager;


        public PersonListController(
            ISession session,
            IClock clock,
            IContentItemDisplayManager contentItemDisplayManager)
        {
            _session = session;
            _clock = clock;
            _contentItemDisplayManager = contentItemDisplayManager;
        }


        public async Task<ActionResult> OlderThan30()
        {
            var thresholdDate = _clock.UtcNow.AddYears(-30);
            var people = await _session
                .Query<ContentItem, PersonPartIndex>(index => index.BirthDateUtc < thresholdDate)
                .ListAsync();

            var shapes = await Task.WhenAll(people.Select(async person =>
                await _contentItemDisplayManager.BuildDisplayAsync(person, this, "Summary")));
            
            return View(shapes);
        }
    }
}
{'fraction_non_alphanumeric': 0.07207735130383827, 'fraction_numerical': 0.006152944623498389, 'mean_word_length': 2.6012658227848102, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '229157', 'n_tokens_mistral': 872, 'n_tokens_neox': 849, 'n_words': 190}