Click or drag to resize

IFulltextSessionDeleteTDocument Method (TDocument)

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

Namespace:  SphinxConnector.FluentApi
Assembly:  SphinxConnector (in SphinxConnector.dll) Version: 5.3.0
Syntax
void Delete<TDocument>(
	TDocument document
)

Parameters

document
Type: TDocument
The document to delete.

Type Parameters

TDocument
The type of document to delete.
Exceptions
ExceptionCondition
ArgumentNullExceptionOccurs when document is null.
ObjectDisposedExceptionOccurs when the session has already been disposed.
Examples
Delete a given document instance:
private void DeleteProduct(Product productToDelete)
{ 
    using (IFulltextSession fulltextSession = fulltextStore.StartSession())
    {
        fulltextSession.Delete(productToDelete);

        fulltextSession.FlushChanges();
    }
}
See Also