Example #1
0
        public string Convert(CSchema schema)
        {
            string[] parts = { schema.SchemaName };

            var createSchemaStatement = new CreateSchemaStatement();

            createSchemaStatement.Name = new Identifier {
                Value = schema.SchemaName
            };

            //generate DDL
            var script = new TSqlScript();
            var batch  = new TSqlBatch();

            script.Batches.Add(batch);
            batch.Statements.Add(createSchemaStatement);
            var dacpacModel = new TSqlModel(SqlServerVersion.Sql120, new TSqlModelOptions());
            var existing    = dacpacModel.GetObject(Schema.TypeClass, new ObjectIdentifier(parts), DacQueryScopes.All);

            if (existing != null)
            {
                return(existing.GetScript());
            }
            dacpacModel.AddObjects(script);
            existing = dacpacModel.GetObject(Schema.TypeClass, new ObjectIdentifier(parts), DacQueryScopes.All);
            return(existing.GetScript());
        }
Example #2
0
 public CrosswordFight()
 {
     State   = EState.Begin;
     Players = new List <Player>()
     {
         new Player("1"), new Player("2")
     };
     Schema        = new CSchema(6, 6);
     CurrentPlayer = 0;
 }
Example #3
0
 public CFileSystemStorage(CSchema aSchema, DirectoryInfo aDirectoryInfo) : base(aSchema)
 {
     if (aSchema.IsNullRef())
     {
         throw new ArgumentNullException(nameof(aSchema));
     }
     if (aDirectoryInfo.IsNullRef())
     {
         throw new ArgumentNullException(nameof(aDirectoryInfo));
     }
     this.DirectoryInfo = aDirectoryInfo;
 }
Example #4
0
 public string GetFlywayFileName(CSchema schema)
 {
     return($"{FlywayVersionNumber}__Create_Schema_{schema.SchemaName}.sql");
 }
Example #5
0
 public string Convert(CSchema schema)
 {
     return($@"CREATE SCHEMA IF NOT EXISTS {schema.SchemaName.WrapReservedAndSnakeCase(DataStoreTypes.MySql, schema.ConvertToSnakeCase)};");
 }
Example #6
0
 public FormCrosswordEditor()
 {
     InitializeComponent();
     _schema = new CSchema(10, 10);
     h_RefreshField(true);
 }
Example #7
0
 public CNullStorage(CSchema aSchema) : base(aSchema)
 {
 }
Example #8
0
 protected CStorage(CSchema aSchema)
 {
     this.Schema = aSchema;
 }