// 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.Entity; using Microsoft.Framework.DependencyInjection; namespace Microsoft.AspNet.Identity { public static class IdentityBuilderExtensions { public static IdentityBuilder AddEntity(this IdentityBuilder builder) where TUser : EntityUser where TRole : EntityRole { builder.Services.AddScoped, InMemoryUserStore>(); builder.Services.AddScoped, UserManager>(); builder.Services.AddScoped, EntityRoleStore>(); builder.Services.AddScoped, RoleManager>(); return builder; } public static IdentityBuilder AddEntity(this IdentityBuilder builder) where TUser : User { builder.Services.AddScoped, UserStore>(); builder.Services.AddScoped>(); return builder; } } }