Skip to content

Commit 188c26e

Browse files
committed
Update to ReSharper RC, apply fixes for new language features
1 parent ec5d24f commit 188c26e

File tree

24 files changed

+50
-56
lines changed

24 files changed

+50
-56
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"jetbrains.resharper.globaltools": {
6-
"version": "2025.3.0-eap07",
6+
"version": "2025.3.0-rc01",
77
"commands": [
88
"jb"
99
],

JsonApiDotNetCore.sln.DotSettings

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,10 @@
7272
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantOverload_002ELocal/@EntryIndexedValue">WARNING</s:String>
7373
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantQueryOrderByAscendingKeyword/@EntryIndexedValue">SUGGESTION</s:String>
7474
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantToStringCallForValueType/@EntryIndexedValue">SUGGESTION</s:String>
75+
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantTypeArgumentsInsideNameof/@EntryIndexedValue">WARNING</s:String>
7576
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RemoveConstructorInvocation/@EntryIndexedValue">SUGGESTION</s:String>
7677
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceSequenceEqualWithConstantPattern/@EntryIndexedValue">WARNING</s:String>
78+
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceWithFieldKeyword/@EntryIndexedValue">WARNING</s:String>
7779
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceWithPrimaryConstructorParameter/@EntryIndexedValue">DO_NOT_SHOW</s:String>
7880
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SimplifyStringInterpolation/@EntryIndexedValue">WARNING</s:String>
7981
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SpecifyStringComparison/@EntryIndexedValue">WARNING</s:String>

src/Examples/DapperExample/TranslationToSql/TreeNodes/TableSourceNode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace DapperExample.TranslationToSql.TreeNodes;
77
/// </summary>
88
internal abstract class TableSourceNode(string? alias) : SqlTreeNode
99
{
10-
public const string IdColumnName = nameof(Identifiable<object>.Id);
10+
public const string IdColumnName = nameof(Identifiable<>.Id);
1111

1212
public abstract IReadOnlyList<ColumnNode> Columns { get; }
1313
public string? Alias { get; } = alias;

src/JsonApiDotNetCore.OpenApi.Swashbuckle/SwaggerComponents/DocumentationOpenApiOperationFilter.cs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using JsonApiDotNetCore.Controllers;
66
using JsonApiDotNetCore.Middleware;
77
using JsonApiDotNetCore.OpenApi.Swashbuckle.JsonApiMetadata.ActionMethods;
8-
using JsonApiDotNetCore.Resources;
98
using JsonApiDotNetCore.Resources.Annotations;
109
using Microsoft.AspNetCore.Mvc.ApiExplorer;
1110
using Microsoft.Net.Http.Headers;
@@ -19,15 +18,15 @@ namespace JsonApiDotNetCore.OpenApi.Swashbuckle.SwaggerComponents;
1918
[UsedImplicitly(ImplicitUseKindFlags.InstantiatedNoFixedConstructorSignature)]
2019
internal sealed class DocumentationOpenApiOperationFilter : IOperationFilter
2120
{
22-
private const string GetPrimaryName = nameof(BaseJsonApiController<Identifiable<int>, int>.GetAsync);
23-
private const string GetSecondaryName = nameof(BaseJsonApiController<Identifiable<int>, int>.GetSecondaryAsync);
24-
private const string GetRelationshipName = nameof(BaseJsonApiController<Identifiable<int>, int>.GetRelationshipAsync);
25-
private const string PostResourceName = nameof(BaseJsonApiController<Identifiable<int>, int>.PostAsync);
26-
private const string PostRelationshipName = nameof(BaseJsonApiController<Identifiable<int>, int>.PostRelationshipAsync);
27-
private const string PatchResourceName = nameof(BaseJsonApiController<Identifiable<int>, int>.PatchAsync);
28-
private const string PatchRelationshipName = nameof(BaseJsonApiController<Identifiable<int>, int>.PatchRelationshipAsync);
29-
private const string DeleteResourceName = nameof(BaseJsonApiController<Identifiable<int>, int>.DeleteAsync);
30-
private const string DeleteRelationshipName = nameof(BaseJsonApiController<Identifiable<int>, int>.DeleteRelationshipAsync);
21+
private const string GetPrimaryName = nameof(BaseJsonApiController<,>.GetAsync);
22+
private const string GetSecondaryName = nameof(BaseJsonApiController<,>.GetSecondaryAsync);
23+
private const string GetRelationshipName = nameof(BaseJsonApiController<,>.GetRelationshipAsync);
24+
private const string PostResourceName = nameof(BaseJsonApiController<,>.PostAsync);
25+
private const string PostRelationshipName = nameof(BaseJsonApiController<,>.PostRelationshipAsync);
26+
private const string PatchResourceName = nameof(BaseJsonApiController<,>.PatchAsync);
27+
private const string PatchRelationshipName = nameof(BaseJsonApiController<,>.PatchRelationshipAsync);
28+
private const string DeleteResourceName = nameof(BaseJsonApiController<,>.DeleteAsync);
29+
private const string DeleteRelationshipName = nameof(BaseJsonApiController<,>.DeleteRelationshipAsync);
3130
private const string PostOperationsName = nameof(BaseJsonApiOperationsController.PostOperationsAsync);
3231

3332
private const string TextCompareETag =

src/JsonApiDotNetCore.OpenApi.Swashbuckle/SwaggerComponents/JsonApiDataContractResolver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ private List<DataProperty> GetDataPropertiesThatExistInResourceClrType(Type reso
6363

6464
foreach (DataProperty? property in dataContract.ObjectProperties)
6565
{
66-
if (property.MemberInfo.Name == nameof(Identifiable<object>.Id))
66+
if (property.MemberInfo.Name == nameof(Identifiable<>.Id))
6767
{
6868
// Schemas of JsonApiDotNetCore resources will obtain an Id property through inheritance of a resource identifier type.
6969
continue;

src/JsonApiDotNetCore/Configuration/JsonApiValidationFilter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ private IServiceProvider GetScopedServiceProvider()
6161

6262
private static bool IsId(string key)
6363
{
64-
return key == nameof(Identifiable<object>.Id) || key.EndsWith($".{nameof(Identifiable<object>.Id)}", StringComparison.Ordinal);
64+
return key == nameof(Identifiable<>.Id) || key.EndsWith($".{nameof(Identifiable<>.Id)}", StringComparison.Ordinal);
6565
}
6666

6767
private static bool IsAtPrimaryEndpoint(IJsonApiRequest request)

src/JsonApiDotNetCore/Configuration/ResourceGraphBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ private Dictionary<string, AttrAttribute>.ValueCollection GetAttributes(Type res
299299

300300
if (attribute == null)
301301
{
302-
if (property.Name == nameof(Identifiable<object>.Id))
302+
if (property.Name == nameof(Identifiable<>.Id))
303303
{
304304
// Although strictly not correct, 'id' is added to the list of attributes for convenience.
305305
// For example, it enables to filter on ID, without the need to special-case existing logic.

src/JsonApiDotNetCore/Errors/InvalidModelStateException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ private static List<ErrorObject> FromModelStateDictionary(IReadOnlyDictionary<st
134134

135135
private static string? ResolveSourcePointerInAttribute(PropertySegment segment, AttrAttribute attribute, IResourceGraph resourceGraph)
136136
{
137-
string sourcePointer = attribute.Property.Name == nameof(Identifiable<object>.Id)
137+
string sourcePointer = attribute.Property.Name == nameof(Identifiable<>.Id)
138138
? $"{segment.SourcePointer ?? "/data"}/{attribute.PublicName}"
139139
: $"{segment.SourcePointer ?? "/data"}/attributes/{attribute.PublicName}";
140140

src/JsonApiDotNetCore/Queries/Parsing/FilterParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ protected virtual ConstantValueConverter GetConstantValueConverterForType(Type d
539539

540540
private ConstantValueConverter GetConstantValueConverterForAttribute(AttrAttribute attribute)
541541
{
542-
if (attribute is { Property.Name: nameof(Identifiable<object>.Id) })
542+
if (attribute is { Property.Name: nameof(Identifiable<>.Id) })
543543
{
544544
return (stringValue, position) =>
545545
{

src/JsonApiDotNetCore/Queries/QueryLayerComposer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,6 @@ protected virtual PaginationExpression GetPagination(IReadOnlyCollection<QueryEx
620620

621621
private static AttrAttribute GetIdAttribute(ResourceType resourceType)
622622
{
623-
return resourceType.GetAttributeByPropertyName(nameof(Identifiable<object>.Id));
623+
return resourceType.GetAttributeByPropertyName(nameof(Identifiable<>.Id));
624624
}
625625
}

0 commit comments

Comments
 (0)