Skip to content

Constructor dependency injection for blazor partial classes #18483

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

Closed
msschl opened this issue Jan 21, 2020 · 2 comments
Closed

Constructor dependency injection for blazor partial classes #18483

msschl opened this issue Jan 21, 2020 · 2 comments
Labels
area-blazor Includes: Blazor, Razor Components

Comments

@msschl
Copy link
Contributor

msschl commented Jan 21, 2020

It would be nice to have constructor based dependency injection for blazor partial classes.

E.g.

namespace Blazor.Pages
{
    public partial class Index
    {
        private readonly string testMessage;

        public Index(IServiceA service)
        {
            this.testMessage = service.GetMessage();
        }
    }
}
@Pilchie Pilchie added the area-blazor Includes: Blazor, Razor Components label Jan 21, 2020
@mrpmorris
Copy link

This is a duplicate of #18088

@msschl
Copy link
Contributor Author

msschl commented Jan 22, 2020

Thanks for pointing this out. Closing this issue

@msschl msschl closed this as completed Jan 22, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Feb 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

No branches or pull requests

3 participants