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

Dependency Injection in Views #128

Closed
danroth27 opened this issue Apr 21, 2015 · 9 comments
Closed

Dependency Injection in Views #128

danroth27 opened this issue Apr 21, 2015 · 9 comments
Assignees
Milestone

Comments

@danroth27
Copy link
Member

ASP.NET MVC -> Views -> Dependency Injection in Views

@ardalis
Copy link
Contributor

ardalis commented Dec 3, 2015

@danroth27 Do you want me to expand on what's already here: https://github.com/aspnet/Docs/blob/master/mvc/views/dependency-injection.rst

@danroth27
Copy link
Member Author

@rynowak @Eilon @NTaylorMullen Does this article need more detail or should we just leave it as is?

@NTaylorMullen
Copy link
Contributor

Hmm, i'm not sure this warrants an entire article.

@Eilon
Copy link
Member

Eilon commented Dec 6, 2015

The doc doesn't really say why you'd want to do this. Are we trying to have some conceptual content in here?

BTW this will eat at me forever unless I say something: there are spaces missing after some of the colons in the code:

          <li>Items: @await Statistics.GetCount()</li>
          <li>Completed:@await Statistics.GetCompletedCount()</li>
          <li>Average Priority:@await Statistics.GetAveragePriority()</li>

@robbert229
Copy link
Contributor

In the community stand up it was stated that the purpose of dependency injection in views is to have the controller not need to know about view specific services.

@ardalis
Copy link
Contributor

ardalis commented Dec 8, 2015

@danroth27 should I write something up that includes some conceptual background and answers @Eilon 's why question?

@danroth27
Copy link
Member Author

@ardalis Sounds good - one example use case is the view localizer service.

@danroth27 danroth27 added this to the 1.0.0-rc2 milestone Dec 9, 2015
@danroth27 danroth27 added mvc and removed 1 - Ready labels Dec 15, 2015
@ardalis
Copy link
Contributor

ardalis commented Jan 16, 2016

@danroth27 it looks like this sample is post-RC1;
https://github.com/aspnet/Mvc/blob/dev/samples/LocalizationSample.Web/Startup.cs
(it doesn't exist in RC1 tag and the DefaultRequestCulture doesn't exist in RC1)
should I hold off on updating this until RC2 drops?

@danroth27
Copy link
Member Author

@ardalis No, let's not wait. We can either refer to the correct APIs in RC1, or just remove the localization content from this article for now.

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

No branches or pull requests

6 participants