Skip to content

Commit b6f6be0

Browse files
Do some more reformatting
1 parent db1e0fa commit b6f6be0

File tree

3 files changed

+39
-31
lines changed

3 files changed

+39
-31
lines changed

src/NHibernate/Async/Engine/Loading/CollectionLoadContext.cs

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ namespace NHibernate.Engine.Loading
2727
public partial class CollectionLoadContext
2828
{
2929

30-
/// <summary>
31-
/// Finish the process of collection-loading for this bound result set. Mainly this
30+
/// <summary>
31+
/// Finish the process of collection-loading for this bound result set. Mainly this
3232
/// involves cleaning up resources and notifying the collections that loading is
33-
/// complete.
33+
/// complete.
3434
/// </summary>
35-
/// <param name="persister">The persister for which to complete loading. </param>
35+
/// <param name="persister">The persister for which to complete loading.</param>
3636
/// <param name="cancellationToken">A cancellation token that can be used to cancel the work</param>
37-
[Obsolete("Please use EndLoadingCollections(ICollectionPersister, HashSet<string>) instead.")]
37+
// Since v5.2
38+
[Obsolete("Please use overload with uncacheableCollections parameter instead.")]
3839
public Task EndLoadingCollectionsAsync(ICollectionPersister persister, CancellationToken cancellationToken)
3940
{
4041
if (cancellationToken.IsCancellationRequested)
@@ -44,13 +45,13 @@ public Task EndLoadingCollectionsAsync(ICollectionPersister persister, Cancellat
4445
return EndLoadingCollectionsAsync(persister, null, cancellationToken);
4546
}
4647

47-
/// <summary>
48-
/// Finish the process of collection-loading for this bound result set. Mainly this
48+
/// <summary>
49+
/// Finish the process of collection-loading for this bound result set. Mainly this
4950
/// involves cleaning up resources and notifying the collections that loading is
50-
/// complete.
51+
/// complete.
5152
/// </summary>
52-
/// <param name="persister">The persister for which to complete loading. </param>
53-
/// <param name="uncacheableCollections">Indicates if collections can be put in cache</param>
53+
/// <param name="persister">The persister for which to complete loading.</param>
54+
/// <param name="uncacheableCollections">Indicates which collections must not be put in cache.</param>
5455
/// <param name="cancellationToken">A cancellation token that can be used to cancel the work</param>
5556
public async Task EndLoadingCollectionsAsync(ICollectionPersister persister, HashSet<string> uncacheableCollections, CancellationToken cancellationToken)
5657
{
@@ -185,9 +186,11 @@ private async Task EndLoadingCollectionAsync(
185186
ce.PostInitialize(lce.Collection, persistenceContext);
186187
}
187188

188-
bool addToCache = hasNoQueuedOperations && persister.HasCache &&
189-
session.CacheMode.HasFlag(CacheMode.Put) &&
190-
(uncacheableCollections == null || !uncacheableCollections.Contains(lce.Persister.Role)) && !ce.IsDoremove; // and this is not a forced initialization during flush
189+
bool addToCache = hasNoQueuedOperations && persister.HasCache &&
190+
session.CacheMode.HasFlag(CacheMode.Put) &&
191+
(uncacheableCollections == null || !uncacheableCollections.Contains(lce.Persister.Role)) &&
192+
// and this is not a forced initialization during flush
193+
!ce.IsDoremove;
191194

192195
if (addToCache)
193196
{

src/NHibernate/Engine/Loading/CollectionLoadContext.cs

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -139,25 +139,26 @@ public IPersistentCollection GetLoadingCollection(ICollectionPersister persister
139139
}
140140
}
141141

142-
/// <summary>
143-
/// Finish the process of collection-loading for this bound result set. Mainly this
142+
/// <summary>
143+
/// Finish the process of collection-loading for this bound result set. Mainly this
144144
/// involves cleaning up resources and notifying the collections that loading is
145-
/// complete.
145+
/// complete.
146146
/// </summary>
147-
/// <param name="persister">The persister for which to complete loading. </param>
148-
[Obsolete("Please use EndLoadingCollections(ICollectionPersister, HashSet<string>) instead.")]
147+
/// <param name="persister">The persister for which to complete loading.</param>
148+
// Since v5.2
149+
[Obsolete("Please use overload with uncacheableCollections parameter instead.")]
149150
public void EndLoadingCollections(ICollectionPersister persister)
150151
{
151152
EndLoadingCollections(persister, null);
152153
}
153154

154-
/// <summary>
155-
/// Finish the process of collection-loading for this bound result set. Mainly this
155+
/// <summary>
156+
/// Finish the process of collection-loading for this bound result set. Mainly this
156157
/// involves cleaning up resources and notifying the collections that loading is
157-
/// complete.
158+
/// complete.
158159
/// </summary>
159-
/// <param name="persister">The persister for which to complete loading. </param>
160-
/// <param name="uncacheableCollections">Indicates if collections can be put in cache</param>
160+
/// <param name="persister">The persister for which to complete loading.</param>
161+
/// <param name="uncacheableCollections">Indicates which collections must not be put in cache.</param>
161162
public void EndLoadingCollections(ICollectionPersister persister, HashSet<string> uncacheableCollections)
162163
{
163164
if (!loadContexts.HasLoadingCollectionEntries && (localLoadingCollectionKeys.Count == 0))
@@ -288,9 +289,11 @@ private void EndLoadingCollection(
288289
ce.PostInitialize(lce.Collection, persistenceContext);
289290
}
290291

291-
bool addToCache = hasNoQueuedOperations && persister.HasCache &&
292-
session.CacheMode.HasFlag(CacheMode.Put) &&
293-
(uncacheableCollections == null || !uncacheableCollections.Contains(lce.Persister.Role)) && !ce.IsDoremove; // and this is not a forced initialization during flush
292+
bool addToCache = hasNoQueuedOperations && persister.HasCache &&
293+
session.CacheMode.HasFlag(CacheMode.Put) &&
294+
(uncacheableCollections == null || !uncacheableCollections.Contains(lce.Persister.Role)) &&
295+
// and this is not a forced initialization during flush
296+
!ce.IsDoremove;
294297

295298
if (addToCache)
296299
{

src/NHibernate/Engine/QueryParameters.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,17 @@ public QueryParameters(IType[] positionalParameterTypes, object[] positionalPara
4646
NaturalKeyLookup = isLookupByNaturalKey;
4747
}
4848

49+
// Since v5.2
4950
[Obsolete("Please use QueryParameters(IDictionary<string, TypedValue>, IDictionary<string, LockMode>, " +
5051
"RowSelection, bool, bool, bool, string, string, bool, IResultTransformer, HashSet<string>) instead.")]
5152
public QueryParameters(IDictionary<string, TypedValue> namedParameters, IDictionary<string, LockMode> lockModes, RowSelection rowSelection, bool isReadOnlyInitialized,
52-
bool readOnly, bool cacheable, string cacheRegion, string comment, bool isLookupByNaturalKey, IResultTransformer transformer)
53+
bool readOnly, bool cacheable, string cacheRegion, string comment, bool isLookupByNaturalKey, IResultTransformer transformer)
5354
: this(
5455
namedParameters, lockModes, rowSelection, isReadOnlyInitialized, readOnly, cacheable, cacheRegion, comment, isLookupByNaturalKey,
5556
transformer, null) {}
5657

5758
public QueryParameters(IDictionary<string, TypedValue> namedParameters, IDictionary<string, LockMode> lockModes, RowSelection rowSelection, bool isReadOnlyInitialized,
58-
bool readOnly, bool cacheable, string cacheRegion, string comment, bool isLookupByNaturalKey, IResultTransformer transformer, HashSet<string> uncacheableCollections)
59+
bool readOnly, bool cacheable, string cacheRegion, string comment, bool isLookupByNaturalKey, IResultTransformer transformer, HashSet<string> uncacheableCollections)
5960
: this(
6061
TypeHelper.EmptyTypeArray, Array.Empty<object>(), namedParameters, lockModes, rowSelection, isReadOnlyInitialized, readOnly, cacheable, cacheRegion, comment, null,
6162
transformer, uncacheableCollections)
@@ -64,6 +65,7 @@ public QueryParameters(IDictionary<string, TypedValue> namedParameters, IDiction
6465
NaturalKeyLookup = isLookupByNaturalKey;
6566
}
6667

68+
// Since v5.2
6769
[Obsolete("Please use QueryParameters(IType[], object[], IDictionary<string, TypedValue>, " +
6870
"IDictionary<string, LockMode>, RowSelection, bool, bool, bool, string, string, object[], IResultTransformer, HashSet<string>) instead.")]
6971
public QueryParameters(IType[] positionalParameterTypes, object[] positionalParameterValues, IDictionary<string, TypedValue> namedParameters,
@@ -74,8 +76,8 @@ public QueryParameters(IType[] positionalParameterTypes, object[] positionalPara
7476
transformer, null) {}
7577

7678
public QueryParameters(IType[] positionalParameterTypes, object[] positionalParameterValues, IDictionary<string, TypedValue> namedParameters,
77-
IDictionary<string, LockMode> lockModes, RowSelection rowSelection, bool isReadOnlyInitialized, bool readOnly, bool cacheable, string cacheRegion,
78-
string comment, object[] collectionKeys, IResultTransformer transformer, HashSet<string> uncacheableCollections)
79+
IDictionary<string, LockMode> lockModes, RowSelection rowSelection, bool isReadOnlyInitialized, bool readOnly, bool cacheable, string cacheRegion,
80+
string comment, object[] collectionKeys, IResultTransformer transformer, HashSet<string> uncacheableCollections)
7981
{
8082
PositionalParameterTypes = positionalParameterTypes ?? Array.Empty<IType>();
8183
PositionalParameterValues = positionalParameterValues ?? Array.Empty<object>();
@@ -160,7 +162,7 @@ public bool HasRowSelection
160162
/// <summary>
161163
/// Indicates if we can add loaded child collections to second level cache.
162164
/// </summary>
163-
public HashSet<string> UncacheableCollections { get; set; }
165+
public HashSet<string> UncacheableCollections { get; }
164166

165167
public bool ReadOnly
166168
{

0 commit comments

Comments
 (0)