Skip to content

Commit 940c28c

Browse files
committed
Resharper: Use collection expression
1 parent 38bfc4e commit 940c28c

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

Diff for: test/JsonApiDotNetCoreMongoDbTests/IntegrationTests/QueryStrings/SparseFieldSets/ResourceCaptureStore.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace JsonApiDotNetCoreMongoDbTests.IntegrationTests.QueryStrings.SparseFiel
44

55
public sealed class ResourceCaptureStore
66
{
7-
internal List<IIdentifiable> Resources { get; } = new();
7+
internal List<IIdentifiable> Resources { get; } = [];
88

99
internal void Add(IEnumerable<IIdentifiable> resources)
1010
{

Diff for: test/JsonApiDotNetCoreMongoDbTests/IntegrationTests/ResourceDefinitions/Reading/StarDefinition.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@ public override SortExpression OnApplySort(SortExpression? existingSort)
2626

2727
private SortExpression GetDefaultSortOrder()
2828
{
29-
return CreateSortExpressionFromLambda(new PropertySortOrder
30-
{
29+
return CreateSortExpressionFromLambda([
3130
(star => star.SolarMass, ListSortDirection.Descending),
3231
(star => star.SolarRadius, ListSortDirection.Descending)
33-
});
32+
]);
3433
}
3534

3635
public override PaginationExpression OnApplyPagination(PaginationExpression? existingPagination)

Diff for: test/TestBuildingBlocks/IntegrationTestContext.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class IntegrationTestContext<TStartup, TMongoDbContextShim> : Integration
3535
{
3636
private readonly Lazy<IMongoRunner> _runner;
3737
private readonly Lazy<WebApplicationFactory<TStartup>> _lazyFactory;
38-
private readonly HashSet<Type> _resourceClrTypes = new();
38+
private readonly HashSet<Type> _resourceClrTypes = [];
3939
private readonly TestControllerProvider _testControllerProvider = new();
4040
private Action<IServiceCollection>? _configureServices;
4141

Diff for: test/TestBuildingBlocks/MongoDbContextShim.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace TestBuildingBlocks;
1010
public abstract class MongoDbContextShim
1111
{
1212
private readonly IMongoDatabase _database;
13-
private readonly List<MongoDbSetShim> _dbSetShims = new();
13+
private readonly List<MongoDbSetShim> _dbSetShims = [];
1414

1515
protected MongoDbContextShim(IMongoDatabase database)
1616
{

Diff for: test/TestBuildingBlocks/MongoDbSetShim.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public sealed class MongoDbSetShim<TEntity> : MongoDbSetShim
1818
where TEntity : IMongoIdentifiable
1919
{
2020
private readonly IMongoCollection<TEntity> _collection;
21-
private readonly List<TEntity> _entitiesToInsert = new();
21+
private readonly List<TEntity> _entitiesToInsert = [];
2222

2323
internal MongoDbSetShim(IMongoCollection<TEntity> collection)
2424
{

0 commit comments

Comments
 (0)