| 123456789101112131415161718192021222324252627 |
- using System.Diagnostics;
- using Microsoft.EntityFrameworkCore;
- using Quadarax.Foundation.Core.Data.Domain;
- namespace Quadarax.Application.QLiberace.Common.Tests.Repositories.Fakes
- {
- public class TestDbContext : DataDomain, IDataDomain
- {
- public DbSet<TestTenantTrackedDao> Tests { get; set; } = null!;
- public TestDbContext() : base(new DbContextOptions<TestDbContext>())
- {
- }
- 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}]");
- }
- }
- }
|