Skip to content

Commit bc53141

Browse files
committed
Fix IDE0290: Use primary constructor
1 parent 5bf36a8 commit bc53141

File tree

2 files changed

+9
-25
lines changed

2 files changed

+9
-25
lines changed

src/JsonApiDotNetCore/Controllers/JsonApiCommandController.cs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,8 @@ namespace JsonApiDotNetCore.Controllers;
1515
/// <typeparam name="TId">
1616
/// The resource identifier type.
1717
/// </typeparam>
18-
public abstract class JsonApiCommandController<TResource, TId> : JsonApiController<TResource, TId>
19-
where TResource : class, IIdentifiable<TId>
20-
{
21-
/// <summary>
22-
/// Creates an instance from a write-only service.
23-
/// </summary>
24-
protected JsonApiCommandController(IJsonApiOptions options, IResourceGraph resourceGraph, ILoggerFactory loggerFactory,
25-
IResourceCommandService<TResource, TId> commandService)
26-
: base(options, resourceGraph, loggerFactory, null, null, null, null, commandService, commandService, commandService, commandService, commandService,
27-
commandService)
28-
{
29-
}
30-
}
18+
public abstract class JsonApiCommandController<TResource, TId>(
19+
IJsonApiOptions options, IResourceGraph resourceGraph, ILoggerFactory loggerFactory, IResourceCommandService<TResource, TId> commandService)
20+
: JsonApiController<TResource, TId>(options, resourceGraph, loggerFactory, null, null, null, null, commandService, commandService, commandService,
21+
commandService, commandService, commandService)
22+
where TResource : class, IIdentifiable<TId>;

src/JsonApiDotNetCore/Controllers/JsonApiQueryController.cs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,7 @@ namespace JsonApiDotNetCore.Controllers;
1515
/// <typeparam name="TId">
1616
/// The resource identifier type.
1717
/// </typeparam>
18-
public abstract class JsonApiQueryController<TResource, TId> : JsonApiController<TResource, TId>
19-
where TResource : class, IIdentifiable<TId>
20-
{
21-
/// <summary>
22-
/// Creates an instance from a read-only service.
23-
/// </summary>
24-
protected JsonApiQueryController(IJsonApiOptions options, IResourceGraph resourceGraph, ILoggerFactory loggerFactory,
25-
IResourceQueryService<TResource, TId> queryService)
26-
: base(options, resourceGraph, loggerFactory, queryService, queryService, queryService, queryService)
27-
{
28-
}
29-
}
18+
public abstract class JsonApiQueryController<TResource, TId>(
19+
IJsonApiOptions options, IResourceGraph resourceGraph, ILoggerFactory loggerFactory, IResourceQueryService<TResource, TId> queryService)
20+
: JsonApiController<TResource, TId>(options, resourceGraph, loggerFactory, queryService, queryService, queryService, queryService)
21+
where TResource : class, IIdentifiable<TId>;

0 commit comments

Comments
 (0)