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"
},
"frameworks": {
"dnx451": {
"frameworkAssemblies": {
"System.Reflection": ""
}
"net451": {
},
"netstandardapp1.5": {
"imports": [

View File

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

View File

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

View File

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