Skip to content

Commit 8f8a1dc

Browse files
committed
Add note about intermediate list allocation
1 parent c205c06 commit 8f8a1dc

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/NHibernate/Linq/LinqExtensionMethods.cs

+18
Original file line numberDiff line numberDiff line change
@@ -2405,6 +2405,9 @@ async Task<List<TSource>> InternalToListAsync()
24052405
/// <summary>
24062406
/// Executes the query and returns its result as a <see cref="HashSet{T}"/>.
24072407
/// </summary>
2408+
/// <remarks>
2409+
/// Note that this method still allocates an intermediate <see cref="List{T}"/> instance from which the result is created.
2410+
/// </remarks>
24082411
/// <param name="source">An <see cref="T:System.Linq.IQueryable`1" /> to return a HashSet from.</param>
24092412
/// <param name="cancellationToken">A cancellation token that can be used to cancel the work.</param>
24102413
/// <typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam>
@@ -2417,6 +2420,9 @@ async Task<List<TSource>> InternalToListAsync()
24172420
/// <summary>
24182421
/// Executes the query and returns its result as a <see cref="HashSet{T}"/>.
24192422
/// </summary>
2423+
/// <remarks>
2424+
/// Note that this method still allocates an intermediate <see cref="List{T}"/> instance from which the result is created.
2425+
/// </remarks>
24202426
/// <param name="source">An <see cref="T:System.Linq.IQueryable`1" /> to return a HashSet from.</param>
24212427
/// <param name="comparer">The <see cref="IEqualityComparer{T}"/> implementation to use when comparing values in the set, or null to use the default <see cref="EqualityComparer{T}"/> implementation for the set type.</param>
24222428
/// <param name="cancellationToken">A cancellation token that can be used to cancel the work.</param>
@@ -2454,6 +2460,9 @@ async Task<List<TSource>> InternalToListAsync()
24542460
/// <summary>
24552461
/// Executes the query and returns its result as a <see cref="Dictionary{TKey, TValue}" /> according to a specified key selector function.
24562462
/// </summary>
2463+
/// <remarks>
2464+
/// Note that this method still allocates an intermediate <see cref="List{T}"/> instance from which the result is created.
2465+
/// </remarks>
24572466
/// <typeparam name="TSource">The type of the elements of <paramref name="source" /></typeparam>
24582467
/// <typeparam name="TKey">The type of the key returned by <paramref name="keySelector" /></typeparam>
24592468
/// <param name="source">An <see cref="T:System.Linq.IQueryable`1" /> to return a Dictionary from.</param>
@@ -2471,6 +2480,9 @@ async Task<List<TSource>> InternalToListAsync()
24712480
/// <summary>
24722481
/// Executes the query and returns its result as a <see cref="Dictionary{TKey, TValue}" /> according to a specified key selector function and a comparer.
24732482
/// </summary>
2483+
/// <remarks>
2484+
/// Note that this method still allocates an intermediate <see cref="List{T}"/> instance from which the result is created.
2485+
/// </remarks>
24742486
/// <typeparam name="TSource">The type of the elements of <paramref name="source" /></typeparam>
24752487
/// <typeparam name="TKey">The type of the key returned by <paramref name="keySelector" /></typeparam>
24762488
/// <param name="source">An <see cref="T:System.Linq.IQueryable`1" /> to return a Dictionary from.</param>
@@ -2489,6 +2501,9 @@ async Task<List<TSource>> InternalToListAsync()
24892501
/// <summary>
24902502
/// Executes the query and returns its result as a <see cref="Dictionary{TKey, TValue}" /> according to a specified key selector function and an element selector function.
24912503
/// </summary>
2504+
/// <remarks>
2505+
/// Note that this method still allocates an intermediate <see cref="List{T}"/> instance from which the result is created.
2506+
/// </remarks>
24922507
/// <typeparam name="TSource">The type of the elements of <paramref name="source" /></typeparam>
24932508
/// <typeparam name="TKey">The type of the key returned by <paramref name="keySelector" /></typeparam>
24942509
/// <typeparam name="TElement">The type of the value returned by <paramref name="elementSelector" />.</typeparam>
@@ -2508,6 +2523,9 @@ async Task<List<TSource>> InternalToListAsync()
25082523
/// <summary>
25092524
/// Executes the query and returns its result as a <see cref="Dictionary{TKey, TValue}" /> according to a specified key selector function, a comparer, and an element selector function.
25102525
/// </summary>
2526+
/// <remarks>
2527+
/// Note that this method still allocates an intermediate <see cref="List{T}"/> instance from which the result is created.
2528+
/// </remarks>
25112529
/// <typeparam name="TSource">The type of the elements of <paramref name="source" /></typeparam>
25122530
/// <typeparam name="TKey">The type of the key returned by <paramref name="keySelector" /></typeparam>
25132531
/// <typeparam name="TElement">The type of the value returned by <paramref name="elementSelector" />.</typeparam>

0 commit comments

Comments
 (0)