Table of Contents

Interface IMongoRepository<T>

Namespace
adas_core.Application.Repositories.Interfaces
Assembly
adas-core.Application.dll
public interface IMongoRepository<T>

Type Parameters

T
Extension Methods

Properties

Collection

IMongoCollection<T> Collection { get; }

Property Value

IMongoCollection<T>

Methods

DeleteAsync(ObjectId)

Asynchronously deletes the entity identified by the specified identifier and returns the deleted entity.

Task<T?> DeleteAsync(ObjectId id)

Parameters

id ObjectId

The unique identifier of the entity to delete.

Returns

Task<T>

A task that represents the asynchronous operation, containing the deleted entity of type T, or null if no matching entity was found.

GetCollectionName()

Gets the name of the collection.

string GetCollectionName()

Returns

string

The name of the collection.

InsertOneAsync(T)

Asynchronously inserts a single object of type T.

Task InsertOneAsync(T obj)

Parameters

obj T

The object to insert.

Returns

Task

A task that represents the asynchronous insert operation.

UpdateOneAsync(ObjectId, T)

Asynchronously updates an existing document identified by the specified identifier with the provided object data.

Task UpdateOneAsync(ObjectId id, T obj)

Parameters

id ObjectId

The unique identifier of the document to update.

obj T

The object containing the updated values to persist.

Returns

Task