public static void Run(string projectFolder, SystemDevelopmentConfiguration configuration, Logger log) { var outputFilePath = Path.Combine(projectFolder, "GeneratedCode", "TypedDataLayer.cs"); log.Info("Writing generated code to " + outputFilePath); var outputDir = Path.GetDirectoryName(outputFilePath); log.Debug("Creating directory: " + outputDir); Directory.CreateDirectory(outputDir); var baseNamespace = configuration.LibraryNamespaceAndAssemblyName + ".DataAccess"; using (var writer = new StreamWriter(outputFilePath)) { writeUsingStatements(writer); var databaseInfo = DatabaseOps.CreateDatabase( DatabaseFactory.CreateDatabaseInfo(configuration.databaseConfiguration.DatabaseType, configuration.databaseConfiguration.ConnectionString)); ExecuteDatabaseUpdatesScript.Run(projectFolder, databaseInfo, log); generateDataAccessCodeForDatabase( log, databaseInfo, projectFolder, writer, baseNamespace, configuration); } }