Exemple #1
0
        public static SqliteDatabaseWindows ImportSchema(
            string filePath,
            bool createOrmAssembly,
            bool saveOrmAssembly,
            string ormAssemblyOutputDirectory)
        {
            SqliteDatabaseWindows result = (SqliteDatabaseWindows)GOCWindows.Instance.GetSerializer(SerializerType.JSON).DeserializeFromFile(
                typeof(SqliteDatabaseWindows),
                new Type[]
            {
                typeof(SqliteDatabaseTableWindows),
                typeof(SqliteDatabaseTableColumnWindows),
                typeof(DatabaseCacheWindows),
                typeof(DatabaseWindows),
                typeof(DatabaseTableWindows),
                typeof(DatabaseTableColumnWindows)
            },
                filePath);

            if (createOrmAssembly)
            {
                result.CreateOrmAssembly(saveOrmAssembly, ormAssemblyOutputDirectory);
            }
            return(result);
        }
Exemple #2
0
 public static void ExportSchema(SqliteDatabaseWindows database, string filePath)
 {
     GOC.Instance.GetSerializer(SerializerType.JSON).SerializeToFile(
         database,
         new Type[]
     {
         typeof(SqliteDatabaseTableWindows),
         typeof(SqliteDatabaseTableColumnWindows),
         typeof(DatabaseCacheWindows),
         typeof(DatabaseWindows),
         typeof(DatabaseTableWindows),
         typeof(DatabaseTableColumnWindows),
         typeof(DatabaseTableForeignKeyColumnsWindows),
         typeof(DatabaseTableKeyColumnsWindows),
         typeof(ForeignKeyInfoWindows),
         typeof(DbmsWindows),
         typeof(SqliteTypeConverterWindows),
         typeof(SqliteTypeConversionInfoWindows)
     },
         filePath);
 }