diff --git a/samples/IdentitySample.Mvc/Startup.cs b/samples/IdentitySample.Mvc/Startup.cs index be5140aa..2e18f635 100644 --- a/samples/IdentitySample.Mvc/Startup.cs +++ b/samples/IdentitySample.Mvc/Startup.cs @@ -66,7 +66,7 @@ namespace IdentitySamples public void Configure(IApplicationBuilder app) { app.UseErrorPage(ErrorPageOptions.ShowAll) - .UseServices() + .UsePerRequestServices() .UseStaticFiles() .UseIdentity() .UseFacebookAuthentication() diff --git a/test/Microsoft.AspNet.Identity.EntityFramework.Test/DefaultPocoTest.cs b/test/Microsoft.AspNet.Identity.EntityFramework.Test/DefaultPocoTest.cs index 85e4de8e..021bb58c 100644 --- a/test/Microsoft.AspNet.Identity.EntityFramework.Test/DefaultPocoTest.cs +++ b/test/Microsoft.AspNet.Identity.EntityFramework.Test/DefaultPocoTest.cs @@ -55,7 +55,7 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test var context = CreateContext(true); var builder = new ApplicationBuilder(new ServiceCollection().BuildServiceProvider()); - builder.UseServices(services => + builder.UsePerRequestServices(services => { services.AddEntityFramework().AddSqlServer(); services.AddIdentitySqlServer(); diff --git a/test/Microsoft.AspNet.Identity.EntityFramework.Test/SqlStoreTestBase.cs b/test/Microsoft.AspNet.Identity.EntityFramework.Test/SqlStoreTestBase.cs index 763c3d1c..d1a11a7c 100644 --- a/test/Microsoft.AspNet.Identity.EntityFramework.Test/SqlStoreTestBase.cs +++ b/test/Microsoft.AspNet.Identity.EntityFramework.Test/SqlStoreTestBase.cs @@ -112,7 +112,7 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test EnsureDatabase(); var builder = new ApplicationBuilder(new ServiceCollection().BuildServiceProvider()); - builder.UseServices(services => + builder.UsePerRequestServices(services => { services.AddInstance(new NullLoggerFactory()); services.AddEntityFramework().AddSqlServer(); @@ -140,7 +140,7 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test EnsureDatabase(); var builder = new ApplicationBuilder(new ServiceCollection().BuildServiceProvider()); - builder.UseServices(services => + builder.UsePerRequestServices(services => { services.AddInstance(new NullLoggerFactory()); services.AddEntityFramework().AddSqlServer(); diff --git a/test/Microsoft.AspNet.Identity.EntityFramework.Test/UserStoreTest.cs b/test/Microsoft.AspNet.Identity.EntityFramework.Test/UserStoreTest.cs index 8e30cf98..c00af1c8 100644 --- a/test/Microsoft.AspNet.Identity.EntityFramework.Test/UserStoreTest.cs +++ b/test/Microsoft.AspNet.Identity.EntityFramework.Test/UserStoreTest.cs @@ -63,7 +63,7 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test EnsureDatabase(); var builder = new ApplicationBuilder(new ServiceCollection().BuildServiceProvider()); - builder.UseServices(services => + builder.UsePerRequestServices(services => { services.AddInstance(new NullLoggerFactory()); services.AddEntityFramework().AddSqlServer(); @@ -91,7 +91,7 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test EnsureDatabase(); var builder = new ApplicationBuilder(new ServiceCollection().BuildServiceProvider()); - builder.UseServices(services => + builder.UsePerRequestServices(services => { services.AddInstance(new NullLoggerFactory()); services.AddEntityFramework().AddSqlServer(); diff --git a/test/Microsoft.AspNet.Identity.InMemory.Test/HttpSignInTest.cs b/test/Microsoft.AspNet.Identity.InMemory.Test/HttpSignInTest.cs index 613da6d6..d8f3ce95 100644 --- a/test/Microsoft.AspNet.Identity.InMemory.Test/HttpSignInTest.cs +++ b/test/Microsoft.AspNet.Identity.InMemory.Test/HttpSignInTest.cs @@ -40,7 +40,7 @@ namespace Microsoft.AspNet.Identity.InMemory.Test response.Setup(r => r.SignIn(It.Is(v => v.IsPersistent == isPersistent), It.IsAny())).Verifiable(); var contextAccessor = new Mock>(); contextAccessor.Setup(a => a.Value).Returns(context.Object); - app.UseServices(services => + app.UsePerRequestServices(services => { services.AddInstance(contextAccessor.Object); services.AddIdentity().AddInMemory(); diff --git a/test/Microsoft.AspNet.Identity.InMemory.Test/StartupTest.cs b/test/Microsoft.AspNet.Identity.InMemory.Test/StartupTest.cs index 899117a6..57f589d5 100644 --- a/test/Microsoft.AspNet.Identity.InMemory.Test/StartupTest.cs +++ b/test/Microsoft.AspNet.Identity.InMemory.Test/StartupTest.cs @@ -21,7 +21,7 @@ namespace Microsoft.AspNet.Identity.InMemory.Test { var builder = new ApplicationBuilder(new ServiceCollection().BuildServiceProvider()); - builder.UseServices(services => services.AddIdentity().AddInMemory()); + builder.UsePerRequestServices(services => services.AddIdentity().AddInMemory()); var userStore = builder.ApplicationServices.GetService>(); var roleStore = builder.ApplicationServices.GetService>(); @@ -40,7 +40,7 @@ namespace Microsoft.AspNet.Identity.InMemory.Test public void VerifyUseInMemoryLifetimes() { var builder = new ApplicationBuilder(new ServiceCollection().BuildServiceProvider()); - builder.UseServices(services => services.AddIdentity().AddInMemory()); + builder.UsePerRequestServices(services => services.AddIdentity().AddInMemory()); var userStore = builder.ApplicationServices.GetService>(); var roleStore = builder.ApplicationServices.GetService>(); diff --git a/test/Microsoft.AspNet.Identity.Test/IdentityOptionsTest.cs b/test/Microsoft.AspNet.Identity.Test/IdentityOptionsTest.cs index 9bbbca15..730d7d7e 100644 --- a/test/Microsoft.AspNet.Identity.Test/IdentityOptionsTest.cs +++ b/test/Microsoft.AspNet.Identity.Test/IdentityOptionsTest.cs @@ -114,7 +114,7 @@ namespace Microsoft.AspNet.Identity.Test public void CanCustomizeIdentityOptions() { var builder = new ApplicationBuilder(new ServiceCollection().BuildServiceProvider()); - builder.UseServices(services => + builder.UsePerRequestServices(services => { services.AddIdentity(); services.AddOptionsAction(); @@ -136,7 +136,7 @@ namespace Microsoft.AspNet.Identity.Test public void CanSetupIdentityOptions() { var app = new ApplicationBuilder(new ServiceCollection().BuildServiceProvider()); - app.UseServices(services => + app.UsePerRequestServices(services => { services.AddIdentity().ConfigureIdentity(options => options.User.RequireUniqueEmail = true); });