React to UsePerRequestServices rename

This commit is contained in:
Hao Kung 2014-10-08 15:51:35 -07:00
Родитель a4ce31c30d
Коммит dd58aeedb1
7 изменённых файлов: 11 добавлений и 11 удалений

Просмотреть файл

@ -66,7 +66,7 @@ namespace IdentitySamples
public void Configure(IApplicationBuilder app)
{
app.UseErrorPage(ErrorPageOptions.ShowAll)
.UseServices()
.UsePerRequestServices()
.UseStaticFiles()
.UseIdentity()
.UseFacebookAuthentication()

Просмотреть файл

@ -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();

Просмотреть файл

@ -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<ILoggerFactory>(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<ILoggerFactory>(new NullLoggerFactory());
services.AddEntityFramework().AddSqlServer();

Просмотреть файл

@ -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<ILoggerFactory>(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<ILoggerFactory>(new NullLoggerFactory());
services.AddEntityFramework().AddSqlServer();

Просмотреть файл

@ -40,7 +40,7 @@ namespace Microsoft.AspNet.Identity.InMemory.Test
response.Setup(r => r.SignIn(It.Is<AuthenticationProperties>(v => v.IsPersistent == isPersistent), It.IsAny<ClaimsIdentity>())).Verifiable();
var contextAccessor = new Mock<IContextAccessor<HttpContext>>();
contextAccessor.Setup(a => a.Value).Returns(context.Object);
app.UseServices(services =>
app.UsePerRequestServices(services =>
{
services.AddInstance(contextAccessor.Object);
services.AddIdentity<ApplicationUser, IdentityRole>().AddInMemory();

Просмотреть файл

@ -21,7 +21,7 @@ namespace Microsoft.AspNet.Identity.InMemory.Test
{
var builder = new ApplicationBuilder(new ServiceCollection().BuildServiceProvider());
builder.UseServices(services => services.AddIdentity<ApplicationUser>().AddInMemory());
builder.UsePerRequestServices(services => services.AddIdentity<ApplicationUser>().AddInMemory());
var userStore = builder.ApplicationServices.GetService<IUserStore<ApplicationUser>>();
var roleStore = builder.ApplicationServices.GetService<IRoleStore<IdentityRole>>();
@ -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<ApplicationUser>().AddInMemory());
builder.UsePerRequestServices(services => services.AddIdentity<ApplicationUser>().AddInMemory());
var userStore = builder.ApplicationServices.GetService<IUserStore<ApplicationUser>>();
var roleStore = builder.ApplicationServices.GetService<IRoleStore<IdentityRole>>();

Просмотреть файл

@ -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<IdentityUser>();
services.AddOptionsAction<PasswordsNegativeLengthSetup>();
@ -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<IdentityUser>().ConfigureIdentity(options => options.User.RequireUniqueEmail = true);
});