Skip to content

Commit 6460471

Browse files
author
Bart Koelman
committed
Added helper to suppress the "method has cancellation support" suggestion and turned that into a warning, so we'll get the right alerts.
1 parent ae18541 commit 6460471

File tree

35 files changed

+99
-92
lines changed

35 files changed

+99
-92
lines changed

JsonApiDotNetCore.sln.DotSettings

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ JsonApiDotNetCore.ArgumentGuard.NotNull($EXPR$, $NAME$);</s:String>
5656
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=LocalizableElement/@EntryIndexedValue">DO_NOT_SHOW</s:String>
5757
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=LoopCanBePartlyConvertedToQuery/@EntryIndexedValue">HINT</s:String>
5858
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MemberCanBeInternal/@EntryIndexedValue">SUGGESTION</s:String>
59+
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MethodHasAsyncOverload/@EntryIndexedValue">WARNING</s:String>
60+
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MethodHasAsyncOverloadWithCancellation/@EntryIndexedValue">WARNING</s:String>
5961
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PatternAlwaysMatches/@EntryIndexedValue">SUGGESTION</s:String>
6062
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PublicConstructorInAbstractClass/@EntryIndexedValue">WARNING</s:String>
6163
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantArrayCreationExpression/@EntryIndexedValue">SUGGESTION</s:String>

test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Controllers/AtomicConstrainedOperationsControllerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public async Task Cannot_add_to_ToMany_relationship_for_matching_resource_type()
168168

169169
await _testContext.RunOnDatabaseAsync(async dbContext =>
170170
{
171-
dbContext.AddRange(existingTrack, existingPerformer);
171+
dbContext.AddInRange(existingTrack, existingPerformer);
172172
await dbContext.SaveChangesAsync();
173173
});
174174

test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ public async Task Can_create_resource_with_attributes_and_multiple_relationship_
720720

721721
await _testContext.RunOnDatabaseAsync(async dbContext =>
722722
{
723-
dbContext.AddRange(existingLyric, existingCompany, existingPerformer);
723+
dbContext.AddInRange(existingLyric, existingCompany, existingPerformer);
724724
await dbContext.SaveChangesAsync();
725725
});
726726

test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public async Task Update_resource_with_side_effects_returns_absolute_links()
4444

4545
await _testContext.RunOnDatabaseAsync(async dbContext =>
4646
{
47-
dbContext.AddRange(existingLanguage, existingCompany);
47+
dbContext.AddInRange(existingLanguage, existingCompany);
4848
await dbContext.SaveChangesAsync();
4949
});
5050

test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ public async Task Can_update_resource_with_annotated_relationship()
264264

265265
await _testContext.RunOnDatabaseAsync(async dbContext =>
266266
{
267-
dbContext.AddRange(existingPlaylist, existingTrack);
267+
dbContext.AddInRange(existingPlaylist, existingTrack);
268268
await dbContext.SaveChangesAsync();
269269
});
270270

@@ -335,7 +335,7 @@ public async Task Can_update_ToOne_relationship()
335335

336336
await _testContext.RunOnDatabaseAsync(async dbContext =>
337337
{
338-
dbContext.AddRange(existingTrack, existingCompany);
338+
dbContext.AddInRange(existingTrack, existingCompany);
339339
await dbContext.SaveChangesAsync();
340340
});
341341

@@ -389,7 +389,7 @@ public async Task Can_update_ToMany_relationship()
389389

390390
await _testContext.RunOnDatabaseAsync(async dbContext =>
391391
{
392-
dbContext.AddRange(existingPlaylist, existingTrack);
392+
dbContext.AddInRange(existingPlaylist, existingTrack);
393393
await dbContext.SaveChangesAsync();
394394
});
395395

test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/ResourceDefinitions/Serialization/AtomicSerializationResourceDefinitionTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ public async Task Skips_on_update_resource_with_ToOne_relationship()
278278

279279
await _testContext.RunOnDatabaseAsync(async dbContext =>
280280
{
281-
dbContext.AddRange(existingTrack, existingCompany);
281+
dbContext.AddInRange(existingTrack, existingCompany);
282282
await dbContext.SaveChangesAsync();
283283
});
284284

@@ -337,7 +337,7 @@ public async Task Skips_on_update_ToOne_relationship()
337337

338338
await _testContext.RunOnDatabaseAsync(async dbContext =>
339339
{
340-
dbContext.AddRange(existingTrack, existingCompany);
340+
dbContext.AddInRange(existingTrack, existingCompany);
341341
await dbContext.SaveChangesAsync();
342342
});
343343

test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicAddToToManyRelationshipTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public async Task Cannot_add_to_HasOne_relationship()
3636

3737
await _testContext.RunOnDatabaseAsync(async dbContext =>
3838
{
39-
dbContext.AddRange(existingTrack, existingCompany);
39+
dbContext.AddInRange(existingTrack, existingCompany);
4040
await dbContext.SaveChangesAsync();
4141
});
4242

test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Relationships/AtomicUpdateToOneRelationshipTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public async Task Can_create_OneToOne_relationship_from_principal_side()
194194

195195
await _testContext.RunOnDatabaseAsync(async dbContext =>
196196
{
197-
dbContext.AddRange(existingLyric, existingTrack);
197+
dbContext.AddInRange(existingLyric, existingTrack);
198198
await dbContext.SaveChangesAsync();
199199
});
200200

@@ -247,7 +247,7 @@ public async Task Can_create_OneToOne_relationship_from_dependent_side()
247247

248248
await _testContext.RunOnDatabaseAsync(async dbContext =>
249249
{
250-
dbContext.AddRange(existingTrack, existingLyric);
250+
dbContext.AddInRange(existingTrack, existingLyric);
251251
await dbContext.SaveChangesAsync();
252252
});
253253

@@ -300,7 +300,7 @@ public async Task Can_create_ManyToOne_relationship()
300300

301301
await _testContext.RunOnDatabaseAsync(async dbContext =>
302302
{
303-
dbContext.AddRange(existingTrack, existingCompany);
303+
dbContext.AddInRange(existingTrack, existingCompany);
304304
await dbContext.SaveChangesAsync();
305305
});
306306

@@ -356,7 +356,7 @@ public async Task Can_replace_OneToOne_relationship_from_principal_side()
356356
await _testContext.RunOnDatabaseAsync(async dbContext =>
357357
{
358358
await dbContext.ClearTableAsync<MusicTrack>();
359-
dbContext.AddRange(existingLyric, existingTrack);
359+
dbContext.AddInRange(existingLyric, existingTrack);
360360
await dbContext.SaveChangesAsync();
361361
});
362362

@@ -415,7 +415,7 @@ public async Task Can_replace_OneToOne_relationship_from_dependent_side()
415415
await _testContext.RunOnDatabaseAsync(async dbContext =>
416416
{
417417
await dbContext.ClearTableAsync<Lyric>();
418-
dbContext.AddRange(existingTrack, existingLyric);
418+
dbContext.AddInRange(existingTrack, existingLyric);
419419
await dbContext.SaveChangesAsync();
420420
});
421421

@@ -474,7 +474,7 @@ public async Task Can_replace_ManyToOne_relationship()
474474
await _testContext.RunOnDatabaseAsync(async dbContext =>
475475
{
476476
await dbContext.ClearTableAsync<RecordCompany>();
477-
dbContext.AddRange(existingTrack, existingCompany);
477+
dbContext.AddInRange(existingTrack, existingCompany);
478478
await dbContext.SaveChangesAsync();
479479
});
480480

test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateResourceTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1511,7 +1511,7 @@ public async Task Can_update_resource_with_attributes_and_multiple_relationship_
15111511

15121512
await _testContext.RunOnDatabaseAsync(async dbContext =>
15131513
{
1514-
dbContext.AddRange(existingTrack, existingLyric, existingCompany, existingPerformer);
1514+
dbContext.AddInRange(existingTrack, existingLyric, existingCompany, existingPerformer);
15151515
await dbContext.SaveChangesAsync();
15161516
});
15171517

test/JsonApiDotNetCoreExampleTests/IntegrationTests/AtomicOperations/Updating/Resources/AtomicUpdateToOneRelationshipTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public async Task Can_create_OneToOne_relationship_from_principal_side()
209209

210210
await _testContext.RunOnDatabaseAsync(async dbContext =>
211211
{
212-
dbContext.AddRange(existingLyric, existingTrack);
212+
dbContext.AddInRange(existingLyric, existingTrack);
213213
await dbContext.SaveChangesAsync();
214214
});
215215

@@ -267,7 +267,7 @@ public async Task Can_create_OneToOne_relationship_from_dependent_side()
267267

268268
await _testContext.RunOnDatabaseAsync(async dbContext =>
269269
{
270-
dbContext.AddRange(existingTrack, existingLyric);
270+
dbContext.AddInRange(existingTrack, existingLyric);
271271
await dbContext.SaveChangesAsync();
272272
});
273273

@@ -325,7 +325,7 @@ public async Task Can_create_ManyToOne_relationship()
325325

326326
await _testContext.RunOnDatabaseAsync(async dbContext =>
327327
{
328-
dbContext.AddRange(existingTrack, existingCompany);
328+
dbContext.AddInRange(existingTrack, existingCompany);
329329
await dbContext.SaveChangesAsync();
330330
});
331331

@@ -386,7 +386,7 @@ public async Task Can_replace_OneToOne_relationship_from_principal_side()
386386
await _testContext.RunOnDatabaseAsync(async dbContext =>
387387
{
388388
await dbContext.ClearTableAsync<MusicTrack>();
389-
dbContext.AddRange(existingLyric, existingTrack);
389+
dbContext.AddInRange(existingLyric, existingTrack);
390390
await dbContext.SaveChangesAsync();
391391
});
392392

@@ -450,7 +450,7 @@ public async Task Can_replace_OneToOne_relationship_from_dependent_side()
450450
await _testContext.RunOnDatabaseAsync(async dbContext =>
451451
{
452452
await dbContext.ClearTableAsync<Lyric>();
453-
dbContext.AddRange(existingTrack, existingLyric);
453+
dbContext.AddInRange(existingTrack, existingLyric);
454454
await dbContext.SaveChangesAsync();
455455
});
456456

@@ -514,7 +514,7 @@ public async Task Can_replace_ManyToOne_relationship()
514514
await _testContext.RunOnDatabaseAsync(async dbContext =>
515515
{
516516
await dbContext.ClearTableAsync<RecordCompany>();
517-
dbContext.AddRange(existingTrack, existingCompany);
517+
dbContext.AddInRange(existingTrack, existingCompany);
518518
await dbContext.SaveChangesAsync();
519519
});
520520

0 commit comments

Comments
 (0)