领胜LDS 键盘AOI检测项目
wells.liu
2020-06-24 533c67339be511fc32e645c450201522ea4d5dfb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//using Bro.Process.Model.Migrations;
//using Bro.Process.Model.Model;
//using System;
//using System.Data.Entity;
//using System.Data.Entity.ModelConfiguration.Conventions;
//using System.Linq;
 
//namespace Bro.M071.Process.Model
//{
//    public class DBModel : DbContext
//    {
//        //您的上下文已配置为从您的应用程序的配置文件(App.config 或 Web.config)
//        //使用“DBModel”连接字符串。默认情况下,此连接字符串针对您的 LocalDb 实例上的
//        //“Bro.Process.Model.DBModel”数据库。
//        // 
//        //如果您想要针对其他数据库和/或数据库提供程序,请在应用程序配置文件中修改“DBModel”
//        //连接字符串。
//        public DBModel()
//            : base("name=DBModel")
//        {
//            ////数据库迁移检查暂时放在构造函数中,回头会放到程序初始化中
//            //Database.SetInitializer(new MigrateDatabaseToLatestVersion<DBModel, Configuration>());
//        }
 
//        //为您要在模型中包含的每种实体类型都添加 DbSet。有关配置和使用 Code First  模型
//        //的详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkId=390109。
 
//        // public virtual DbSet<MyEntity> MyEntities { get; set; }
//        //public virtual DbSet<PRODUCTION_SECRETKEY> PRODUCTION_SECRETKEY { get; set; }
//        //public virtual DbSet<PRODUCTION_CONFIG> PRODUCTION_CONFIG { get; set; }
 
 
//        public virtual DbSet<ProductionDetectionRecords> ProductionDetectionRecords { get; set; }
//        public virtual DbSet<ProductionDetectionRecordsDetail> ProductionDetectionRecordsDetail { get; set; }
//        public virtual DbSet<OperationRecords> OperationRecords { get; set; }
//        public virtual DbSet<ProductionDetectionImageRecords> ProductionDetectionImageRecords { get; set; }
//        public virtual DbSet<ManualDetectionRecords> ManualDetectionRecords { get; set; }
//        public virtual DbSet<EventTimeRecords> EventTimeRecords { get; set; }
 
//        protected override void OnModelCreating(DbModelBuilder modelBuilder)
//        {
//            //base.OnModelCreating(modelBuilder);
 
//            #region for sqlite db
//            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
//            modelBuilder.Configurations.AddFromAssembly(typeof(DBModel).Assembly);
//            #endregion
//        }
//    }
 
//    public static class DatabaseInitialize
//    {
//        public static void Initialize()
//        {
//            Database.SetInitializer(new MigrateDatabaseToLatestVersion<DBModel, Configuration>());
//            using (DbContext dbContext = new DBModel())
//            {
//                dbContext.Database.Initialize(true);
//            }
//        }
//    }
//    //public class MyEntity
//    //{
//    //    public int Id { get; set; }
//    //    public string Name { get; set; }
//    //}
//}