LogDbContext.cs 599 B

12345678910111213141516171819
  1. using Microsoft.EntityFrameworkCore;
  2. using Repository.Entiies;
  3. using System;
  4. namespace Repository
  5. {
  6. public class LogDbContext: DbContext
  7. {
  8. protected override void OnConfiguring(DbContextOptionsBuilder options)
  9. {
  10. options.EnableSensitiveDataLogging();
  11. var connetionString = $"Data Source={AppDomain.CurrentDomain.BaseDirectory}logs.db";
  12. options.UseSqlite(connetionString).UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking);
  13. base.OnConfiguring(options);
  14. }
  15. public DbSet<Log> Logs { get; set; }
  16. }
  17. }