Class
DocumentRepositoryRegistry

Provides a registry for associating document types with their corresponding document repositories.

Definition

Namespace:Telerik.Documents.AI.Tools.Core

Assembly:Telerik.Documents.AI.Tools.Core.dll

Syntax:

cs-api-definition
public class DocumentRepositoryRegistry

Inheritance: objectDocumentRepositoryRegistry

Constructors

DocumentRepositoryRegistry()

Declaration

cs-api-definition
public DocumentRepositoryRegistry()

Methods

RegisterRepository(DocumentType, IDocumentRepository)

Registers the specified document repository for the given document type.

Declaration

cs-api-definition
public void RegisterRepository(DocumentType documentType, IDocumentRepository repository)

Parameters

documentType

DocumentType

The type of document for which the repository is being registered.

repository

IDocumentRepository

The repository instance to associate with the specified document type. Cannot be null.

Exceptions

ArgumentNullException

Thrown if repository is null.

TryGetRepository(DocumentType, out IDocumentRepository)

Attempts to retrieve the repository associated with the specified document type.

Declaration

cs-api-definition
public bool TryGetRepository(DocumentType documentType, out IDocumentRepository repository)

Parameters

documentType

DocumentType

The type of document for which to retrieve the repository.

repository

IDocumentRepository

When this method returns, contains the repository associated with the specified document type, if found; otherwise, null. This parameter is passed uninitialized.

Returns

bool

true if a repository for the specified document type was found; otherwise, false.

Remarks

This method does not throw an exception if the repository is not found. Use the returned Boolean value to determine whether the repository was successfully retrieved.