зеркало из https://github.com/aspnet/Identity.git
React to UsePerRequestServices rename
This commit is contained in:
Родитель
a4ce31c30d
Коммит
dd58aeedb1
|
@ -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);
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче