Skip to content

Missing CTOR in JsonApiQueryController #537

Closed
@maurei

Description

@maurei

For read-only resources we can use JsonApiQueryController to expose only the actions that are associated to reading. However, the only available constructor has a dependency on IResourceService:

public JsonApiQueryController( 
	IJsonApiContext jsonApiContext, 
	IResourceService<T, TId> resourceService) 
 : base(jsonApiContext, resourceService) { }

If one were to make a resource that is truly read-only, it should not be required to fully implement IResourceService, but just IResourceQueryService should be enough. A constructor should be added to allow for this:

public JsonApiQueryController( 
	IJsonApiContext jsonApiContext, 
	IResourceQueryService<T, TId> resourceQueryService) 
 : base(jsonApiContext, resourceQueryService) { }

original issue #535

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions