Replies: 1 comment 1 reply
-
Keyed services IMO is a poorly implemented hack to fix an issue for poorly implemented code. Image providers already work in isolation. The middleware will use whichever one returns match for the path and ignore the rest. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In a current project I needed to handle two distinct image sources with different paths/naming conventions and
IImageProviders
.It was important they didn't "cross streams", so I thought I'd be nice if I could just stand up two completely different named configs (using named options and maybe the new keyed services feature) and then be able to do something like this to bind a specific config with a specific middleware instance:
For now I'm checking
Request.PathBase
inside the image provider which seems to work, but looks pretty hacky to me because it couples the provider to the middleware usage/position.Beta Was this translation helpful? Give feedback.
All reactions