Skip to content

Missing CTOR in JsonApiQueryController #537

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

Closed
maurei opened this issue Jul 4, 2019 · 0 comments
Closed

Missing CTOR in JsonApiQueryController #537

maurei opened this issue Jul 4, 2019 · 0 comments

Comments

@maurei
Copy link
Member

maurei commented Jul 4, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant