From 77e0ee34ff8c65f1a4f6c6e7349c0e890da78006 Mon Sep 17 00:00:00 2001 From: jaredcnance Date: Mon, 11 Dec 2017 18:02:34 -0600 Subject: [PATCH] feat(JsonApiController: Expose CQRS constructor Closes #205 --- .../Controllers/JsonApiController.cs | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/JsonApiDotNetCore/Controllers/JsonApiController.cs b/src/JsonApiDotNetCore/Controllers/JsonApiController.cs index bea2105482..97350127ba 100644 --- a/src/JsonApiDotNetCore/Controllers/JsonApiController.cs +++ b/src/JsonApiDotNetCore/Controllers/JsonApiController.cs @@ -16,6 +16,18 @@ public JsonApiController( ILoggerFactory loggerFactory) : base(jsonApiContext, resourceService, loggerFactory) { } + + public JsonApiController( + IJsonApiContext jsonApiContext, + IGetAllService getAll = null, + IGetByIdService getById = null, + IGetRelationshipService getRelationship = null, + IGetRelationshipsService getRelationships = null, + ICreateService create = null, + IUpdateService update = null, + IUpdateRelationshipService updateRelationships = null, + IDeleteService delete = null + ) : base(jsonApiContext, getAll, getById, getRelationship, getRelationships, create, update, updateRelationships, delete) { } } public class JsonApiController @@ -34,6 +46,18 @@ public JsonApiController( : base(jsonApiContext, resourceService) { } + public JsonApiController( + IJsonApiContext jsonApiContext, + IGetAllService getAll = null, + IGetByIdService getById = null, + IGetRelationshipService getRelationship = null, + IGetRelationshipsService getRelationships = null, + ICreateService create = null, + IUpdateService update = null, + IUpdateRelationshipService updateRelationships = null, + IDeleteService delete = null + ) : base(jsonApiContext, getAll, getById, getRelationship, getRelationships, create, update, updateRelationships, delete) { } + [HttpGet] public override async Task GetAsync() => await base.GetAsync();