Class DocumentDataRequestBase<TConnection, TResult>
Serves as the base class for implementing document store requests with a specific connection type and return model.
public abstract class DocumentDataRequestBase<TConnection, TResult> : IDocumentDataRequest<TConnection, TResult>
Type Parameters
TConnectionThe type of the document database connection.
TResultThe type of the result returned by the request.
- Inheritance
-
DocumentDataRequestBase<TConnection, TResult>
- Implements
-
IDocumentDataRequest<TConnection, TResult>
- Derived
- Inherited Members
- Extension Methods
Properties
CollectionName
Gets the collection name for the document operation.
public string CollectionName { get; protected set; }
Property Value
- string
The collection name for the document operation.
OperationType
Gets the operation type (e.g., "Insert", "Find", "Update", "Delete", "Aggregate").
public string OperationType { get; protected set; }
Property Value
- string
The operation type (e.g., "Insert", "Find", "Update", "Delete", "Aggregate").
Options
Gets optional operation-specific options (e.g., write concerns, read preferences).
public IReadOnlyDictionary<string, object>? Options { get; protected set; }
Property Value
- IReadOnlyDictionary<string, object>
Optional operation-specific options (e.g., write concerns, read preferences).
Parameters
Gets the operation parameters as a read-only dictionary.
public IReadOnlyDictionary<string, object> Parameters { get; protected set; }
Property Value
- IReadOnlyDictionary<string, object>
The operation parameters as a read-only dictionary.
ResolveAsync
Gets the function responsible for resolving the request result using the provided connection.
public Func<TConnection, Task<TResult>> ResolveAsync { get; protected set; }
Property Value
- Func<TConnection, Task<TResult>>
The function responsible for resolving the request result using the provided connection.
Methods
InitializeOperation(string, string, IDictionary<string, object>, IDictionary<string, object>?)
Creates a document operation with the specified parameters.
protected void InitializeOperation(string collectionName, string operationType, IDictionary<string, object> parameters, IDictionary<string, object>? options = null)
Parameters
collectionNamestringThe name of the collection to operate on.
operationTypestringThe type of operation being performed.
parametersIDictionary<string, object>The operation parameters.
optionsIDictionary<string, object>Optional operation-specific options.
Exceptions
- ArgumentException
Thrown when collection name or operation type is null or empty.