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
How do I inject Options into the View? #916
Comments
Since For the Razor squiggles, is the issue that you're using the wrong parantheses:
|
@pranavkm Ah! Gotcha. Thanks. |
For anyone else, remember you have to fully qualify the interface to inject.
|
I have an Azure CDN endpoint coming from Configuration that I'm trying to hold in Options and inject into views where it will be used. I'm stuck ... the .NET docs don't show the markup code for view options injection and Rick's post doesn't seem to be updated for beta7. I'm on dnx-coreclr-win-x64.1.0.0-beta7, and this is a dnxcore50 app.
Model
(Confused on best practices here: Does this even go in Models?)
Startup
HomeController
Markup
If everything else above is ok, the markup part is unclear to me. How do I inject this?
@model MyApp.Models.AppOptions
@inject MyApp.Models.AppOptions AppOptions
src=
... how do I break the property lookup at the "CDN" before the period prior to "vo"?... same result if I use
@model MyApp.Models.AppOptions
and@{Model.CDN}.vo...
or@Model.CDN.vo...
.The text was updated successfully, but these errors were encountered: