// 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.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; namespace Microsoft.AspNetCore.Identity.Service.EntityFrameworkCore.InMemory.Test { public class InMemoryContext : InMemoryContext { public InMemoryContext(DbContextOptions options) : base(options) { } } public class InMemoryContext : InMemoryContext where TUser : IdentityUser where TApplication : IdentityServiceApplication { public InMemoryContext(DbContextOptions options) : base(options) { } } public class InMemoryContext : IdentityServiceDbContext where TUser : IdentityUser where TRole : IdentityRole where TUserKey : IEquatable where TApplication : IdentityServiceApplication where TApplicationKey : IEquatable { public InMemoryContext(DbContextOptions options) : base(options) { } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseInMemoryDatabase("Scratch"); } } public abstract class InMemoryContext< TUser, TRole, TUserKey, TUserClaim, TUserRole, TUserLogin, TRoleClaim, TUserToken, TApplication, TScope, TApplicationClaim, TRedirectUri, TApplicationKey> : IdentityServiceDbContext where TUser : IdentityUser where TRole : IdentityRole where TUserKey : IEquatable where TUserClaim : IdentityUserClaim where TUserRole : IdentityUserRole where TUserLogin : IdentityUserLogin where TRoleClaim : IdentityRoleClaim where TUserToken : IdentityUserToken where TApplication : IdentityServiceApplication where TScope : IdentityServiceScope where TApplicationClaim : IdentityServiceApplicationClaim where TRedirectUri : IdentityServiceRedirectUri where TApplicationKey : IEquatable { public InMemoryContext(DbContextOptions options) : base(options) { } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseInMemoryDatabase("Scratch"); } } }