Reacting to EF changes

This commit is contained in:
Pranav K 2016-03-14 11:08:00 -07:00
parent 5fba08562f
commit c068128098
4 changed files with 4 additions and 9 deletions

View File

@ -35,10 +35,7 @@
"web": "IdentitySample.Mvc" "web": "IdentitySample.Mvc"
}, },
"frameworks": { "frameworks": {
"dnx451": { "net451": {
"frameworkAssemblies": {
"System.Reflection": ""
}
}, },
"netstandardapp1.5": { "netstandardapp1.5": {
"imports": [ "imports": [

View File

@ -25,8 +25,8 @@ namespace Microsoft.AspNetCore.Identity.EntityFrameworkCore.InMemory.Test
public async Task CanCreateRoleWithSingletonManager() public async Task CanCreateRoleWithSingletonManager()
{ {
var services = TestIdentityFactory.CreateTestServices(); var services = TestIdentityFactory.CreateTestServices();
services.AddAddEntityFrameworkInMemoryDatabase(); services.AddEntityFrameworkInMemoryDatabase();
services.AddTransient<InMemoryContext>(); services.AddSingleton(new InMemoryContext(new DbContextOptionsBuilder().Options));
services.AddTransient<IRoleStore<IdentityRole>, RoleStore<IdentityRole, InMemoryContext>>(); services.AddTransient<IRoleStore<IdentityRole>, RoleStore<IdentityRole, InMemoryContext>>();
services.AddSingleton<RoleManager<IdentityRole>>(); services.AddSingleton<RoleManager<IdentityRole>>();
var provider = services.BuildServiceProvider(); var provider = services.BuildServiceProvider();

View File

@ -4,7 +4,6 @@
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Internal; using Microsoft.AspNetCore.Http.Internal;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
namespace Microsoft.AspNetCore.Identity.EntityFrameworkCore.InMemory.Test namespace Microsoft.AspNetCore.Identity.EntityFrameworkCore.InMemory.Test
@ -14,7 +13,7 @@ namespace Microsoft.AspNetCore.Identity.EntityFrameworkCore.InMemory.Test
public static InMemoryContext CreateContext() public static InMemoryContext CreateContext()
{ {
var services = new ServiceCollection(); var services = new ServiceCollection();
services.AddAddEntityFrameworkInMemoryDatabase(); services.AddEntityFrameworkInMemoryDatabase();
var serviceProvider = services.BuildServiceProvider(); var serviceProvider = services.BuildServiceProvider();
var db = new InMemoryContext(new DbContextOptionsBuilder().Options); var db = new InMemoryContext(new DbContextOptionsBuilder().Options);

View File

@ -25,7 +25,6 @@ namespace Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test
services services
.AddDbContext<IdentityDbContext>(o => o.UseSqlServer(fixture.ConnectionString)) .AddDbContext<IdentityDbContext>(o => o.UseSqlServer(fixture.ConnectionString))
.ServiceCollection()
.AddIdentity<IdentityUser, IdentityRole>() .AddIdentity<IdentityUser, IdentityRole>()
.AddEntityFrameworkStores<IdentityDbContext>(); .AddEntityFrameworkStores<IdentityDbContext>();