Skip to content

Small usability improvements regarding instantiating a UriMaker.#14

Open
anaximander23 wants to merge 7 commits intopmhsfelix:masterfrom
anaximander23:master
Open

Small usability improvements regarding instantiating a UriMaker.#14
anaximander23 wants to merge 7 commits intopmhsfelix:masterfrom
anaximander23:master

Conversation

@anaximander23
Copy link
Copy Markdown

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