/// <summary>
        /// Initializes the underlying contextual storage.
        /// </summary>
        /// <returns>
        /// The immutable stack containing active ambient database contexts.
        /// </returns>
        private IImmutableStack <IAmbientDbContext> PrepareStorageAndStack()
        {
            var storage = AmbientDbContextStorageProvider.Storage;

            _storageHelper = new ContextualStorageHelper(storage);

            return(_storageHelper.GetStack());
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AmbientDbContextLocator"/> class.
 /// </summary>
 public AmbientDbContextLocator()
 {
     _storageHelper = new ContextualStorageHelper(AmbientDbContextStorageProvider.Storage);
 }