Skip to content

Renamed Cmd to Command in class names #685

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/usage/extensibility/services.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ IResourceService
│ └── IGetRelationshipsService
| GET /{id}/relationships/{relationship}
|
└── IResourceCmdService
└── IResourceCommandService
|
├── ICreateService
| POST /
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public void ConfigureServices()
_services.AddScoped(typeof(IResourceService<,>), typeof(DefaultResourceService<,>));

_services.AddScoped(typeof(IResourceQueryService<,>), typeof(DefaultResourceService<,>));
_services.AddScoped(typeof(IResourceCmdService<,>), typeof(DefaultResourceService<,>));
_services.AddScoped(typeof(IResourceCommandService<,>), typeof(DefaultResourceService<,>));

_services.AddSingleton<ILinksConfiguration>(JsonApiOptions);
_services.AddSingleton(resourceGraph);
Expand Down
14 changes: 7 additions & 7 deletions src/JsonApiDotNetCore/Controllers/BaseJsonApiController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,17 @@ public BaseJsonApiController(
public BaseJsonApiController(
IJsonApiOptions jsonApiOptions,
IResourceQueryService<T, TId> queryService = null,
IResourceCmdService<T, TId> cmdService = null)
IResourceCommandService<T, TId> commandService = null)
{
_jsonApiOptions = jsonApiOptions;
_getAll = queryService;
_getById = queryService;
_getRelationship = queryService;
_getRelationships = queryService;
_create = cmdService;
_update = cmdService;
_updateRelationships = cmdService;
_delete = cmdService;
_create = commandService;
_update = commandService;
_updateRelationships = commandService;
_delete = commandService;
}

/// <param name="jsonApiOptions"></param>
Expand Down Expand Up @@ -205,8 +205,8 @@ IResourceService<T, int> resourceService
public BaseJsonApiController(
IJsonApiOptions jsonApiOptions,
IResourceQueryService<T, int> queryService = null,
IResourceCmdService<T, int> cmdService = null
) : base(jsonApiOptions, queryService, cmdService) { }
IResourceCommandService<T, int> commandService = null
) : base(jsonApiOptions, queryService, commandService) { }


public BaseJsonApiController(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@

namespace JsonApiDotNetCore.Controllers
{
public class JsonApiCmdController<T> : JsonApiCmdController<T, int>
public class JsonApiCommandController<T> : JsonApiCommandController<T, int>
where T : class, IIdentifiable<int>
{
public JsonApiCmdController(
public JsonApiCommandController(
IJsonApiOptions jsonApiOptions,
IResourceService<T, int> resourceService)
: base(jsonApiOptions, resourceService)
{ }
}

public class JsonApiCmdController<T, TId>
public class JsonApiCommandController<T, TId>
: BaseJsonApiController<T, TId> where T : class, IIdentifiable<TId>
{
public JsonApiCmdController(
public JsonApiCommandController(
IJsonApiOptions jsonApiOptions,
IResourceService<T, TId> resourceService)
: base(jsonApiOptions, resourceService)
Expand Down
4 changes: 2 additions & 2 deletions src/JsonApiDotNetCore/Graph/ServiceDiscoveryFacade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ public class ServiceDiscoveryFacade : IServiceDiscoveryFacade
internal static HashSet<Type> ServiceInterfaces = new HashSet<Type> {
typeof(IResourceService<>),
typeof(IResourceService<,>),
typeof(IResourceCmdService<>),
typeof(IResourceCmdService<,>),
typeof(IResourceCommandService<>),
typeof(IResourceCommandService<,>),
typeof(IResourceQueryService<>),
typeof(IResourceQueryService<,>),
typeof(ICreateService<>),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

namespace JsonApiDotNetCore.Services
{
public interface IResourceCmdService<T> :
public interface IResourceCommandService<T> :
ICreateService<T>,
IUpdateService<T>,
IUpdateRelationshipService<T>,
IDeleteService<T>,
IResourceCmdService<T, int>
IResourceCommandService<T, int>
where T : class, IIdentifiable<int>
{ }

public interface IResourceCmdService<T, in TId> :
public interface IResourceCommandService<T, in TId> :
ICreateService<T, TId>,
IUpdateService<T, TId>,
IUpdateRelationshipService<T, TId>,
Expand Down
4 changes: 2 additions & 2 deletions src/JsonApiDotNetCore/Services/Contract/IResourceService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
namespace JsonApiDotNetCore.Services
{
public interface IResourceService<T>
: IResourceCmdService<T>, IResourceQueryService<T>, IResourceService<T, int>
: IResourceCommandService<T>, IResourceQueryService<T>, IResourceService<T, int>
where T : class, IIdentifiable<int>
{ }

public interface IResourceService<T, in TId>
: IResourceCmdService<T, TId>, IResourceQueryService<T, TId>
: IResourceCommandService<T, TId>, IResourceQueryService<T, TId>
where T : class, IIdentifiable<TId>
{ }
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void AddResourceService_Registers_All_Shorthand_Service_Interfaces()
// Assert
var provider = services.BuildServiceProvider();
Assert.IsType<IntResourceService>(provider.GetService(typeof(IResourceService<IntResource>)));
Assert.IsType<IntResourceService>(provider.GetService(typeof(IResourceCmdService<IntResource>)));
Assert.IsType<IntResourceService>(provider.GetService(typeof(IResourceCommandService<IntResource>)));
Assert.IsType<IntResourceService>(provider.GetService(typeof(IResourceQueryService<IntResource>)));
Assert.IsType<IntResourceService>(provider.GetService(typeof(IGetAllService<IntResource>)));
Assert.IsType<IntResourceService>(provider.GetService(typeof(IGetByIdService<IntResource>)));
Expand All @@ -116,7 +116,7 @@ public void AddResourceService_Registers_All_LongForm_Service_Interfaces()
// Assert
var provider = services.BuildServiceProvider();
Assert.IsType<GuidResourceService>(provider.GetService(typeof(IResourceService<GuidResource, Guid>)));
Assert.IsType<GuidResourceService>(provider.GetService(typeof(IResourceCmdService<GuidResource, Guid>)));
Assert.IsType<GuidResourceService>(provider.GetService(typeof(IResourceCommandService<GuidResource, Guid>)));
Assert.IsType<GuidResourceService>(provider.GetService(typeof(IResourceQueryService<GuidResource, Guid>)));
Assert.IsType<GuidResourceService>(provider.GetService(typeof(IGetAllService<GuidResource, Guid>)));
Assert.IsType<GuidResourceService>(provider.GetService(typeof(IGetByIdService<GuidResource, Guid>)));
Expand Down