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

Add component for managing a DI scope #12793

Merged
merged 1 commit into from
Aug 1, 2019
Merged

Conversation

rynowak
Copy link
Member

@rynowak rynowak commented Aug 1, 2019

Fixes: #5496
Fixes: #10448

This change adds a utility base class that encourages you to do the
right thing when you need to interact with a disposable scoped or
transient service.

This solution ties the lifetime of a DI scope and a service to a
component instance. Note that this is not recursive - we expect users to
pass services like this around (or as cascading values) if the design
dictates it.

Copy link
Member

@SteveSandersonMS SteveSandersonMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving because, although I've added a bunch of comments, I'm sure you'll make good choices about what (if anything) to do with each of them. I don't have any worries about the overall plan here.

@rynowak rynowak force-pushed the rynowak/owning-component branch 2 times, most recently from 4cc21f5 to 2748dc3 Compare August 1, 2019 16:54
Fixes: #5496
Fixes: #10448

This change adds a *utility* base class that encourages you to do the
right thing when you need to interact with a disposable scoped or
transient service.

This solution ties the lifetime of a DI scope and a service to a
component instance. Note that this is not recursive - we expect users to
pass services like this around (or as cascading values) if the design
dictates it.
@Pilchie Pilchie added the area-blazor Includes: Blazor, Razor Components label Aug 1, 2019
@rynowak rynowak merged commit 001b54f into release/3.0 Aug 1, 2019
@ghost ghost deleted the rynowak/owning-component branch August 1, 2019 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants