Ejemplo n.º 1
0
        static void HandleMigrationSqlAdd(string?projectPath, bool verbose, IConsole console)
        {
            var efLog   = new EfEXLog(console, verbose);
            var project = new EFProject(projectPath, efLog);

            efLog.LogVerbose("Validated all required project paths");
            var migrations = new EFExSqlDesigner(project, efLog);
        }
Ejemplo n.º 2
0
 public EFExSqlDesigner(EFProject proj, EfEXLog log)
 {
     Migrations = new Dictionary <string, EFEXSqlMigration?>();
     foreach (var file in Directory.GetFiles(proj.MigrationPath))
     {
         if (!file.ToLower().EndsWith(".sql.designer.json"))
         {
             continue;
         }
         log.LogVerbose($"Processing designer file {file}");
         var jsonString    = File.ReadAllText(file);
         var fileName      = Path.GetFileName(file);
         var migrationName = fileName.ToLower().Replace(".sql.designer.json", "");
         log.LogVerbose($"Migration name found to be {migrationName}");
         var migObject = JsonSerializer.Deserialize <EFEXSqlMigration>(jsonString);
         Migrations.Add(migrationName, migObject);
         log.LogVerbose($"Successfully deserialized migration json file {file} for processing");
     }
 }