Skip to content

Commit 031af89

Browse files
author
Bart Koelman
committed
Fix cibuild
1 parent 1f56ae8 commit 031af89

File tree

5 files changed

+5
-13
lines changed

5 files changed

+5
-13
lines changed

src/JsonApiDotNetCore/ObjectExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ public static T[] AsArray<T>(this T element)
2121

2222
public static List<T> AsList<T>(this T element)
2323
{
24-
return new List<T>
24+
return new()
2525
{
2626
element
2727
};
2828
}
2929

3030
public static HashSet<T> AsHashSet<T>(this T element)
3131
{
32-
return new HashSet<T>
32+
return new()
3333
{
3434
element
3535
};

src/JsonApiDotNetCore/Serialization/Building/LinkBuilder.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,7 @@ private string ChangeTopPageSize(string pageSizeParameterValue, PageSize topPage
149149
{
150150
var topPageSizeElement = new PaginationElementQueryStringValueExpression(null, topPageSize.Value);
151151

152-
if (elementInTopScopeIndex != -1)
153-
{
154-
elements = elements.SetItem(elementInTopScopeIndex, topPageSizeElement);
155-
}
156-
else
157-
{
158-
elements = elements.Insert(0, topPageSizeElement);
159-
}
152+
elements = elementInTopScopeIndex != -1 ? elements.SetItem(elementInTopScopeIndex, topPageSizeElement) : elements.Insert(0, topPageSizeElement);
160153
}
161154
else
162155
{

src/JsonApiDotNetCore/Serialization/RequestDeserializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ private OperationContainer ParseForCreateOrUpdateResourceOperation(AtomicOperati
192192

193193
ResourceContext resourceContextInRef = GetExistingResourceContext(operation.Ref.Type);
194194

195-
if (resourceContextInRef != primaryResourceContext)
195+
if (!primaryResourceContext.Equals(resourceContextInRef))
196196
{
197197
throw new JsonApiSerializationException("Resource type mismatch between 'ref.type' and 'data.type' element.",
198198
$"Expected resource of type '{resourceContextInRef.PublicName}' in 'data.type', instead of '{primaryResourceContext.PublicName}'.",

test/JsonApiDotNetCoreExampleTests/IntegrationTests/Archiving/TelevisionBroadcastDefinition.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private bool IsRequestingCollectionOfTelevisionBroadcasts()
6464
{
6565
if (_request.IsCollection)
6666
{
67-
if (_request.PrimaryResource == ResourceContext || _request.SecondaryResource == ResourceContext)
67+
if (ResourceContext.Equals(_request.PrimaryResource) || ResourceContext.Equals(_request.SecondaryResource))
6868
{
6969
return true;
7070
}

test/JsonApiDotNetCoreExampleTests/IntegrationTests/RestrictedControllers/SkipCacheQueryStringParameterReader.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System.Linq;
21
using JetBrains.Annotations;
32
using JsonApiDotNetCore.Controllers.Annotations;
43
using JsonApiDotNetCore.Errors;

0 commit comments

Comments
 (0)