コード例 #1
0
        public static void Main(string[] args)
        {
            string _ProjectName = "dotnetframework";
            string _TablePath   = "dotnetframework.Entities.Table";

            //Code First
            Assembly       assembly = Assembly.Load(_ProjectName);
            SqlSugarClient Db       = SqlSugarHelper.Instantiate();

            Db.CodeFirst.BackupTable().InitTables(assembly.GetTypes().Where(i => i.Namespace == _TablePath).Where(i => i.IsClass).ToArray());

            CreateHostBuilder(args).Build().Run();
        }
コード例 #2
0
 public DbContext()
 {
     Db = SqlSugarHelper.Instantiate();
 }