IFulltextSessionDeleteTDocument(TDocument) Method

Schedules the given document for deletion. The document will be deleted when FlushChanges is called.

Definition

Namespace: SphinxConnector.FluentApi
Assembly: SphinxConnector (in SphinxConnector.dll) Version: 6.1.0
C#
void Delete<TDocument>(
	TDocument document
)

Parameters

document  TDocument
The document to delete.

Type Parameters

TDocument
The type of document to delete.

Example

Delete a given document instance:
C#
private void DeleteProduct(Product productToDelete)
{ 
    using (IFulltextSession fulltextSession = fulltextStore.StartSession())
    {
        fulltextSession.Delete(productToDelete);

        fulltextSession.FlushChanges();
    }
}

Exceptions

ArgumentNullExceptionOccurs when document is null.
ObjectDisposedExceptionOccurs when the session has already been disposed.

See Also