BaseInMemoryDbContext.cs 600 B

123456789101112131415161718
  1. using Microsoft.EntityFrameworkCore;
  2. using System.Diagnostics;
  3. namespace Quadarax.Application.QLiberace.Base.Tests
  4. {
  5. public class BaseInMemoryDbContext : QlbrcDbContext
  6. {
  7. protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
  8. {
  9. var dbName = "test" + DateTime.Now.ToFileTime().ToString();
  10. optionsBuilder.UseInMemoryDatabase(dbName)
  11. .LogTo(message => Debug.WriteLine("EFSQL>>" + message));
  12. Debug.WriteLine($"*** {GetType().Name} - Context created [{dbName}]");
  13. }
  14. }
  15. }