コード例 #1
0
        public override async Task <object> ReadFromAsync(DbDataReader reader, ICollectionPersister persister, ICollectionAliases descriptor, object owner, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();
            object element = await(persister.ReadElementAsync(reader, owner, descriptor.SuffixedElementAliases, Session, cancellationToken)).ConfigureAwait(false);
            object id      = await(persister.ReadIdentifierAsync(reader, descriptor.SuffixedIdentifierAlias, Session, cancellationToken)).ConfigureAwait(false);

            // eliminate duplication if loaded in a cartesian product
            if (!_identifiers.ContainsValue(id))
            {
                _identifiers[_values.Count] = id;
                _values.Add((T)element);
            }
            return(element);
        }