@@ -15,22 +15,19 @@ public class TodoItemService : JsonApiResourceService<TodoItem>
1515{
1616 private readonly INotificationService _notificationService ;
1717
18- public TodoItemService (
19- IResourceRepositoryAccessor repositoryAccessor ,
20- IQueryLayerComposer queryLayerComposer ,
21- IPaginationContext paginationContext ,
22- IJsonApiOptions options ,
23- ILoggerFactory loggerFactory ,
24- IJsonApiRequest request ,
18+ public TodoItemService (IResourceRepositoryAccessor repositoryAccessor ,
19+ IQueryLayerComposer queryLayerComposer , IPaginationContext paginationContext ,
20+ IJsonApiOptions options , ILoggerFactory loggerFactory , IJsonApiRequest request ,
2521 IResourceChangeTracker <TodoItem > resourceChangeTracker ,
2622 IResourceHookExecutorFacade hookExecutor )
27- : base (repositoryAccessor , queryLayerComposer , paginationContext , options , loggerFactory ,
28- request , resourceChangeTracker , hookExecutor )
23+ : base (repositoryAccessor , queryLayerComposer , paginationContext , options ,
24+ loggerFactory , request , resourceChangeTracker , hookExecutor )
2925 {
3026 _notificationService = notificationService ;
3127 }
3228
33- public override async Task <TodoItem > CreateAsync (TodoItem resource , CancellationToken cancellationToken )
29+ public override async Task <TodoItem > CreateAsync (TodoItem resource ,
30+ CancellationToken cancellationToken )
3431 {
3532 // Call the base implementation
3633 var newResource = await base .CreateAsync (resource , cancellationToken );
@@ -69,7 +66,8 @@ public class ProductService : IResourceService<Product>
6966 _dao = dao ;
7067 }
7168
72- public async Task <IReadOnlyCollection <Product >> GetAsync (CancellationToken cancellationToken )
69+ public async Task <IReadOnlyCollection <Product >> GetAsync (
70+ CancellationToken cancellationToken )
7371 {
7472 return await _dao .GetProductsAsync (cancellationToken );
7573 }
@@ -152,22 +150,22 @@ Then in the controller, you should inherit from the base controller and pass the
152150``` c#
153151public class ArticlesController : BaseJsonApiController <Article >
154152{
155- public ArticlesController (
156- IJsonApiOptions options ,
157- ILoggerFactory loggerFactory ,
158- ICreateService <Article , int > create ,
159- IDeleteService <Article , int > delete )
153+ public ArticlesController (IJsonApiOptions options , ILoggerFactory loggerFactory ,
154+ ICreateService <Article , int > create , IDeleteService <Article , int > delete )
160155 : base (options , loggerFactory , create : create , delete : delete )
161- { }
156+ {
157+ }
162158
163159 [HttpPost ]
164- public override async Task <IActionResult > PostAsync ([FromBody ] Article resource , CancellationToken cancellationToken )
160+ public override async Task <IActionResult > PostAsync ([FromBody ] Article resource ,
161+ CancellationToken cancellationToken )
165162 {
166163 return await base .PostAsync (resource , cancellationToken );
167164 }
168165
169166 [HttpDelete (" {id}" )]
170- public override async Task<IActionResult>DeleteAsync (int id , CancellationToken cancellationToken )
167+ public override async Task<IActionResult>DeleteAsync (int id ,
168+ CancellationToken cancellationToken )
171169 {
172170 return await base .DeleteAsync (id , cancellationToken );
173171 }
0 commit comments