Esempio n. 1
0
        private Transaction(IMergeConfigStore persistable, Action <IMergeConfigStore> onCloseTransactionCallback)
        {
            if (persistable is Transaction)
            {
                throw new InvalidOperationException(
                          "Cannot start new transaction as a transaction is already active. Only one active transaction is allowed.");
            }

            this.persistable = persistable.CheckNotNull(nameof(persistable));
            this.onCloseTransactionCallback = onCloseTransactionCallback.CheckNotNull(nameof(onCloseTransactionCallback));
        }
Esempio n. 2
0
        internal static Config <T> CreateInternal <T>(Func <T> createDefault, IMergeConfigStore store)
            where T : class
        {
            createDefault.CheckNotNull(nameof(createDefault));
            store.CheckNotNull(nameof(store));

            var cfg = createDefault();

            store.EnsureExists(Toml.Create(cfg));

            return(new Config <T>(store));
        }
Esempio n. 3
0
 internal Config(IMergeConfigStore persistable)
 {
     this.persistable = persistable.CheckNotNull(nameof(persistable));
 }