Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

Multiple IViewLocationProviders? #2871

Open
benjamin-hodgson opened this issue Mar 7, 2018 · 1 comment
Open

Multiple IViewLocationProviders? #2871

benjamin-hodgson opened this issue Mar 7, 2018 · 1 comment

Comments

@benjamin-hodgson
Copy link

I want to implement a custom IViewLocationProvider to put in a library. I want to set up some custom view locations for use with a custom view engine, and fall back to the default strategy when it doesn't match. This is because I want my library to coexist happily with other view engines.

However it looks like NancyInternalConfiguration only allows for a single ViewLocationProvider to be configured; it's a Type and not an IEnumerable<Type> or anything like that. My next thought was to wrap an existing IViewLocationProvider in my object and delegate to it, but there doesn't seem to be a clean way of getting hold of the default provider (it'll have been overridden by my custom one!)

NB I don't want to hard-code FileSystemViewLocationProvider as the fallback. The fallback strategy should be configurable.

Any tips?

@dineshpannu
Copy link

I'm looking for exactly the same thing, but don't mind writing my own IViewLocationProvider to do it. How would you go about using FileSystemViewLocationProvider by default and falling back to ResourceViewLocationProvider?

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

No branches or pull requests

2 participants