Skip to content

Commit 00d9b11

Browse files
committed
#10: replacing direct scope setter with call to SetAutofacLifetimeScope
* also changed string constants with nameof() for consistency
1 parent 3f2ad2c commit 00d9b11

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Autofac.Integration.Owin/AutofacAppBuilderExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ private static IAppBuilder RegisterAutofacLifetimeScopeInjector(this IAppBuilder
404404
var lifetimeScope = scopeProvider(context);
405405
try
406406
{
407-
context.Set(Constants.OwinLifetimeScopeKey, lifetimeScope);
407+
context.SetAutofacLifetimeScope(lifetimeScope);
408408
await next();
409409
}
410410
finally

src/Autofac.Integration.Owin/OwinContextExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static ILifetimeScope GetAutofacLifetimeScope(this IOwinContext context)
2020
{
2121
if (context == null)
2222
{
23-
throw new ArgumentNullException("context");
23+
throw new ArgumentNullException(nameof(context));
2424
}
2525

2626
return context.Get<ILifetimeScope>(Constants.OwinLifetimeScopeKey);
@@ -39,12 +39,12 @@ public static void SetAutofacLifetimeScope(this IOwinContext context, ILifetimeS
3939
{
4040
if (context == null)
4141
{
42-
throw new ArgumentNullException("context");
42+
throw new ArgumentNullException(nameof(context));
4343
}
4444

4545
if (scope == null)
4646
{
47-
throw new ArgumentNullException("scope");
47+
throw new ArgumentNullException(nameof(scope));
4848
}
4949

5050
context.Set(Constants.OwinLifetimeScopeKey, scope);

0 commit comments

Comments
 (0)