using System.Diagnostics; using Microsoft.EntityFrameworkCore; using Quadarax.Foundation.Core.Data.Domain; namespace qdr.fnd.core.test.Repositories.Fakes { public class TestDbContext : DataDomain, IDataDomain { public DbSet Daos { get; set; } = null!; public TestDbContext() : base(new DbContextOptions()) { } public TestDbContext(DbContextOptions options) : base(options) { } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { var dbName = "test" + DateTime.Now.ToFileTime().ToString(); optionsBuilder.UseInMemoryDatabase(dbName) .LogTo(message => Debug.WriteLine("EFSQL>>" + message)); Debug.WriteLine($"*** {GetType().Name} - Context created [{dbName}]"); } } }