public static SQLiteTableMeta GetMeta <T>(SQLiteConnection connection)
        {
            string metaString = connection.prefix + typeof(T).Name + TableMetaExtension;

            var item = SQLiteStorageModes.GetItem(metaString, connection.StorageMode);

            if (item == null)
            {
                var newMeta = createMeta <T>(metaString, connection);

                memoryTableMeta.Add(metaString, newMeta);

                return(newMeta);
            }
            else
            {
                SQLiteTableMeta oldMeta = null;
                // if there is an exception...
                if (memoryTableMeta.ContainsKey(metaString))
                {
                    oldMeta = memoryTableMeta[metaString];
                }
                else
                {
                    oldMeta = JsonConvert.DeserializeObject <SQLiteTableMeta>(item);

                    memoryTableMeta.Add(metaString, oldMeta);
                }

                oldMeta._innerConnection = connection;
                oldMeta._metaString      = metaString;
                return(oldMeta);
            }
        }
Example #2
0
 private string getTable <T>()
 {
     return(SQLiteStorageModes.GetItem(prefix + typeof(T).Name, StorageMode));
 }