A persistence store based on an append-only log.
Inheritance: PersistenceStore
Beispiel #1
0
        public static void Write (string File) {

            var Store = new LogPersistenceStore(File);

            foreach (var Record in Store) {
                Console.Write("Got Record Key {0} ID {1}", Record.PrimaryKey, Record.TransactionID);
                foreach (var Key in Record.Keys) {
                    Write(Key);
                    }
                }

            }
        /// <summary>
        /// Dump out records in a specified log
        /// </summary>
        /// <param name="File">Filename of log file to dump.</param>
        public static void Dump(string File) {

            var Store = new LogPersistenceStore(File);

            foreach (var Record in Store) {
                Console.WriteLine("Record Key {0} ID {1}", Record.PrimaryKey, Record.TransactionID);
                if (Record.Keys != null) {
                    foreach (var Key in Record.Keys) {
                        Dump(Key);
                        }
                    }
                if (Record as DataItem != null) {
                    Dump(Record as DataItem);
                    }
                }

            }