<commit_before>﻿using System.Collections.Generic;
using MicroORM.Query;
using System.Linq;

namespace MicroORM.Base
{
    public class ObjectSet<T>
    {
        private List<T> _list = new List<T>();

        internal ObjectSet<T> Load(IDbSession dbSession, IQuery query)
        {
            ObjectReader<T> reader = dbSession.GetObjectReader<T>(query);
            while (reader.Read())
            {
                _list.Add(reader.Current);
            }

            return this;
        }

        internal T SingleOrDefault()
        {
            return _list.SingleOrDefault();
        }
    }
}<commit_msg>Enumerator zum Durchlaufen der ForEach-Schleife.<commit_after>﻿using System.Collections;
using System.Collections.Generic;
using System.Linq;
using MicroORM.Query;

namespace MicroORM.Base
{
    public class ObjectSet<T> : IEnumerable<T>
    {
        private List<T> _list = new List<T>();

        internal ObjectSet<T> Load(IDbSession dbSession, IQuery query)
        {
            ObjectReader<T> reader = dbSession.GetObjectReader<T>(query);
            while (reader.Read())
            {
                _list.Add(reader.Current);
            }

            return this;
        }

        internal T SingleOrDefault()
        {
            return _list.SingleOrDefault();
        }

        public IEnumerator<T> GetEnumerator()
        {
            return _list.GetEnumerator();
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }
    }
}
{'fraction_non_alphanumeric': 0.09869281045751634, 'fraction_numerical': 0.0, 'mean_word_length': 1.872420262664165, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '5796334', 'n_tokens_mistral': 429, 'n_tokens_neox': 428, 'n_words': 86}