Raven.Client.Embedded.EmbeddableDocumentStore.Dispose C# (CSharp) Method

Dispose() public method

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
return void
		public override void Dispose()
		{
			if (wasDisposed)
				return;
			wasDisposed = true;
			base.Dispose();

			if(databaseChanges != null)
				databaseChanges.Dispose();
			if (idleTimer != null)
				idleTimer.Dispose();
			if (DocumentDatabase != null)
				DocumentDatabase.Dispose();
			if (httpServer != null)
				httpServer.Dispose();


			var onDisposed = Disposed;
			if (onDisposed != null)
				onDisposed();
		}

Usage Example

		public void RunningInEmbeddedMode()
		{
			#region running_in_embedded_mode
			var documentStore = new EmbeddableDocumentStore { DataDirectory = "path/to/database/directory" };
			documentStore.Initialize();

			#endregion

			documentStore.Dispose();
		}
All Usage Examples Of Raven.Client.Embedded.EmbeddableDocumentStore::Dispose