Exemplo n.º 1
0
        public ExecuteResultEnum Update(ISchemaUpdateCommandOptions options)
        {
            var schemaName  = options.SchemaName;
            var schemaIndex = FindIndexByName(schemaName);

            if (schemaIndex < 0)
            {
                _reportService.Error($"Cant find schema '{schemaName}'");
                return(ExecuteResultEnum.Error);
            }

            var status = options.Status;

            if (!string.IsNullOrEmpty(status))
            {
                _configFile.Config.Schema[schemaIndex].Status = Enum.Parse <SchemaStatusEnum>(status);
            }

            _configFile.Save(_configFile.Config);

            _reportService.Output($"Schema '{schemaName}' updated.");
            return(ExecuteResultEnum.Succeeded);
        }
Exemplo n.º 2
0
 public SchemaUpdateCommandOptions(ISchemaUpdateCommandOptions options)
     : base(options)
 {
     _options = options;
 }