TeamDataContext.cs 802 B

1234567891011121314151617181920212223
  1. using Microsoft.EntityFrameworkCore;
  2. using System;
  3. using Repository.Entiies;
  4. namespace Repository
  5. {
  6. public class TeamDataContext : DbContext
  7. {
  8. protected override void OnConfiguring(DbContextOptionsBuilder options)
  9. {
  10. options.EnableSensitiveDataLogging();
  11. var connetionString = $"Data Source={AppDomain.CurrentDomain.BaseDirectory}data.db";
  12. options.UseSqlite(connetionString).UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking);
  13. base.OnConfiguring(options);
  14. }
  15. public DbSet<TestResult> ProductResult { get; set; }
  16. public DbSet<ParamLog> ParamLogs { get; set; }
  17. public DbSet<StatisticsLog> StatisticsLogs { get; set; }
  18. public DbSet<Information> Informations { get; set; }
  19. }
  20. }