// Copyright (c) .NET Foundation. 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; using Microsoft.Data.Entity; using System; namespace Microsoft.Framework.DependencyInjection { public static class IdentityEntityFrameworkBuilderExtensions { public static IdentityBuilder AddEntityFrameworkStores(this IdentityBuilder builder) where TContext : DbContext { builder.Services.Add(IdentityEntityFrameworkServices.GetDefaultServices(builder.UserType, builder.RoleType, typeof(TContext))); return builder; } public static IdentityBuilder AddEntityFrameworkStores(this IdentityBuilder builder) where TContext : DbContext where TKey : IEquatable { builder.Services.Add(IdentityEntityFrameworkServices.GetDefaultServices(builder.UserType, builder.RoleType, typeof(TContext), typeof(TKey))); return builder; } } }