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 DisposeScopeOnAppDisposing to AutofacWebApiAppBuilderExtensions. #2

Merged

Conversation

chriseldredge
Copy link
Contributor

Implements #1.

[SecuritySafeCritical]
public static IAppBuilder DisposeScopeOnAppDisposing(this IAppBuilder app, ILifetimeScope lifetimeScope)
{
var context = new OwinContext(app.Properties);
Copy link
Member

Choose a reason for hiding this comment

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

Check lifetimeScope for null, throw ArgumentNullException

@tillig
Copy link
Member

tillig commented Sep 8, 2015

This looks awesome. If we can get a null check on lifetimeScope in there, I'll merge.

@chriseldredge
Copy link
Contributor Author

Added checks for both arguments since it is technically possible (though unlikely) to invoke an extension method on a null instance of IAppBuilder.

@tillig
Copy link
Member

tillig commented Sep 8, 2015

Rock and roooooooll 🎸

tillig added a commit that referenced this pull request Sep 8, 2015
…p-disposing

Add DisposeScopeOnAppDisposing to AutofacWebApiAppBuilderExtensions.
@tillig tillig merged commit 87152dd into autofac:master Sep 8, 2015
@tillig
Copy link
Member

tillig commented Sep 21, 2015

I'm realizing as I read this that it probably should be in Autofac.Owin rather than in the Web API specific library. My bad on not seeing that before.

When I get this library ready to go for 4.0.0 I may move the method so folks using OWIN but not necessarily Web API can make use of it.

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

Successfully merging this pull request may close these issues.

2 participants