/// <summary> /// 检查迁移 /// </summary> /// <param name="db"></param> static void CheckMigrations(TibosDbContext db) { try { //执行迁移 db.Database.Migrate(); } catch (Exception e) { Console.WriteLine(e); throw; } }
static void Main(string[] args) { using (var db = new TibosDbContext()) { //检查迁移 CheckMigrations(db); } //DictRepository Dict = new DictRepository(new TibosDbContext()); //var dict_list = Dict.GetList(); //var count = Dict.Count(); //ManagerRepository Manager = new ManagerRepository(new DhmDbContext()); //var manager_list = Manager.GetList(); }