// 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 System; using Microsoft.EntityFrameworkCore; namespace Microsoft.AspNetCore.Identity.EntityFrameworkCore.InMemory.Test { public class InMemoryContext : InMemoryContext { public InMemoryContext(DbContextOptions options) : base(options) { } } public class InMemoryContext : IdentityUserContext where TUser : IdentityUser { public InMemoryContext(DbContextOptions options) : base(options) { } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseInMemoryDatabase("ScratchUsers"); } } public class InMemoryContext : IdentityDbContext where TUser : IdentityUser where TRole : IdentityRole where TKey : IEquatable { public InMemoryContext(DbContextOptions options) : base(options) { } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseInMemoryDatabase("Scratch"); } } public abstract class InMemoryContext : IdentityDbContext where TUser : IdentityUser where TRole : IdentityRole where TKey : IEquatable where TUserClaim : IdentityUserClaim where TUserRole : IdentityUserRole where TUserLogin : IdentityUserLogin where TRoleClaim : IdentityRoleClaim where TUserToken : IdentityUserToken { public InMemoryContext(DbContextOptions options) : base(options) { } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) => optionsBuilder.UseInMemoryDatabase("Scratch"); } }