MyDb.cs 1000 B

123456789101112131415161718192021222324252627282930313233343536
  1. using CommonStorage.Model;
  2. using MySql.Data.MySqlClient;
  3. using System.Data.Common;
  4. using System.Data.Entity;
  5. namespace CommonStorage
  6. {
  7. //[DbConfigurationType(typeof(MySqlEFConfiguration))]
  8. public class MyDb : DbContext
  9. {
  10. /// <summary>
  11. /// 日志
  12. /// </summary>
  13. public DbSet<Log> logs { get; set; }
  14. public DbSet<User> users { get; set; }
  15. public DbSet<AppConfig> appConfigs { get; set; }
  16. public DbSet<Device> devices { get; set; }
  17. public DbSet<TestData> testDatas { get; set; }
  18. public DbSet<ReportConfig> reportConfigs { get; set; }
  19. public DbSet<TpsConfig> tpsConfigs { get; set; }
  20. public MyDb(DbConnection existingConnection, bool contextOwnsConnection)
  21. : base(existingConnection, contextOwnsConnection)
  22. {
  23. }
  24. protected override void OnModelCreating(DbModelBuilder modelBuilder)
  25. {
  26. base.OnModelCreating(modelBuilder);
  27. }
  28. }
  29. }