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(); }
public DbContext() { Db = SqlSugarHelper.Instantiate(); }