public override Command Create() { Command command = new Command("ddd") { _idOption, _scriptNameOption, }; command.Description = CLITextResources.CreateNewDevDummyDataScriptFileCommandDescription; command.Handler = CommandHandler.Create <string, string>((id, scriptName) => { _consoleProcessMessages.StartProcessMessage("new ddd", id); _consoleProcessMessages.StartSpiiner(); ProcessResults processResults = _dbVersionsAPI.CreateNewDevDummyDataScriptFile(id, scriptName, _consoleProcessMessages.OnNotificationStateChanged); _consoleProcessMessages.StopSpinner(); _consoleProcessMessages.ProcessComplete(processResults); if (!processResults.Trace.HasError) { string newFilePath = (string)processResults.Results; _consoleProcessMessages.SetInfoMessage(CLITextResources.TheFileIsCreatedInfoMessage.Replace("[newFilePath]", newFilePath)); } }); return(command); }
public static ProcessResults CreateNewDevDummyDataScriptFile(string id, string scriptName, Action <ProcessTrace, StepNotificationState> onNotificationStateChanged) { lock (_processSyncLock) { return(_dbVersionsAPI.CreateNewDevDummyDataScriptFile(id, scriptName, onNotificationStateChanged)); } }