Skip to content
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

Small usability improvements regarding instantiating a UriMaker. #14

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

anaximander23
Copy link

The main change here is to make UriMaker<T> inherit from UriMaker. This is mostly a "principle of least surprise" thing; in a lot of places the generic version is just calling through to the non-generic one, so it's clear that it is an extension and not a separate object. It also allows consuming code to specify a property of type UriMaker in a base controller class, and assign the generic version to it.

Following on, the second change is to add an alternate form of the TryGetUriMakerFor<T>() method that can be used from outside the controller class. This allows a base class to have this.TryGetUriMaker(Request); and when called from a derived class, a UriMaker<T> of the correct type is returned.

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

Successfully merging this pull request may close these issues.

1 participant