Skip to content

Commit d62892a

Browse files
hazzikgliljas
authored andcommitted
Fix missing possible async calls. Enforce rules.
1 parent 7834f53 commit d62892a

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ dotnet_diagnostic.NUnit2031.severity = suggestion
2727
dotnet_diagnostic.NUnit2049.severity = suggestion
2828
# The SameAs constraint always fails on value types as the actual and the expected value cannot be the same reference
2929
dotnet_diagnostic.NUnit2040.severity = suggestion
30+
dotnet_diagnostic.CA1849.severity = error
31+
dotnet_diagnostic.CA2007.severity = error
32+
dotnet_code_quality.CA2007.output_kind = DynamicallyLinkedLibrary
3033

3134
[*.xsd]
3235
indent_style = tab

src/NHibernate.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1313
..\appveyor.yml = ..\appveyor.yml
1414
..\ReleaseProcedure.txt = ..\ReleaseProcedure.txt
1515
..\global.json = ..\global.json
16+
..\.editorconfig = ..\.editorconfig
1617
EndProjectSection
1718
EndProject
1819
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NHibernate", "NHibernate\NHibernate.csproj", "{5909BFE7-93CF-4E5F-BE22-6293368AF01D}"

src/NHibernate/Action/BulkOperationCleanupAction.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ public virtual void Init()
166166
[Obsolete("This method has no more usage in NHibernate and will be removed in a future version.")]
167167
public virtual async Task InitAsync(CancellationToken cancellationToken)
168168
{
169-
await EvictEntityRegionsAsync(cancellationToken);
170-
await EvictCollectionRegionsAsync(cancellationToken);
169+
await EvictEntityRegionsAsync(cancellationToken).ConfigureAwait(false);
170+
await EvictCollectionRegionsAsync(cancellationToken).ConfigureAwait(false);
171171
}
172172
}
173173
}

src/NHibernate/AdoNet/DbBatchBatcher.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,16 @@ protected override async Task DoExecuteBatchAsync(DbCommand ps, CancellationToke
167167
try
168168
{
169169
Log.Debug("Executing batch");
170-
await (CheckReadersAsync(cancellationToken)).ConfigureAwait(false);
171-
await (PrepareAsync(_currentBatch, cancellationToken)).ConfigureAwait(false);
170+
await CheckReadersAsync(cancellationToken).ConfigureAwait(false);
171+
await PrepareAsync(_currentBatch, cancellationToken).ConfigureAwait(false);
172172
if (Factory.Settings.SqlStatementLogger.IsDebugEnabled)
173173
{
174174
Factory.Settings.SqlStatementLogger.LogBatchCommand(_currentBatchCommandsLog.ToString());
175175
}
176176
int rowsAffected;
177177
try
178178
{
179-
rowsAffected = _currentBatch.ExecuteNonQuery();
179+
rowsAffected = await _currentBatch.ExecuteNonQueryAsync(cancellationToken).ConfigureAwait(false);
180180
}
181181
catch (DbException e)
182182
{

0 commit comments

Comments
 (0)