// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNet.Identity.SqlServer; using Microsoft.AspNet.Identity.SqlServer.InMemory.Test; using Microsoft.Data.Entity; using Microsoft.Framework.DependencyInjection; namespace Microsoft.AspNet.Identity { public static class EntityInMemoryTestServiceCollectionExtensions { public static IdentityBuilder AddIdentityInMemory(this ServiceCollection services, InMemoryContext context) { return services.AddIdentityInMemory(context); } public static IdentityBuilder AddIdentityInMemory(this ServiceCollection services, TDbContext context) where TUser : IdentityUser where TRole : IdentityRole where TDbContext : DbContext { var builder = services.AddIdentity(); services.AddInstance>(new InMemoryUserStore(context)); var store = new RoleStore(context); services.AddInstance>(store); //services.AddInstance(context); //services.AddScoped(); //services.AddScoped, InMemoryUserStore>(); //services.AddScoped, RoleStore>(); return builder; } } }