Table of Contents

Interface ICameraRepository

Namespace
adas_core.Application.Repositories.Interfaces
Assembly
adas-core.Application.dll
public interface ICameraRepository : IMongoRepository<Camera>
Inherited Members
Extension Methods

Methods

GetById(ObjectId)

Asynchronously retrieves a Camera by its unique identifier.

Task<Camera?> GetById(ObjectId cameraId)

Parameters

cameraId ObjectId

The unique identifier of the camera to look up.

Returns

Task<Camera>

A task that represents the asynchronous operation. The task result contains the matching Camera, or null if no camera is found with the specified identifier.

GetByName(string)

Asynchronously retrieves a camera by its name, returning null if no matching camera is found.

Task<Camera?> GetByName(string name)

Parameters

name string

The name of the camera to look up.

Returns

Task<Camera>

A Task<TResult> that resolves to the matching Camera, or null if no camera with the specified name exists.

GetCameraInList(List<ObjectId>)

Retrieves the list of Camera objects associated with the specified configuration relays.

List<Camera> GetCameraInList(List<ObjectId> configurationRelayList)

Parameters

configurationRelayList List<ObjectId>

The list of MongoDB.Bson.ObjectId values identifying the configuration relays whose cameras should be returned.

Returns

List<Camera>

A List<T> containing the cameras linked to the provided configuration relays; returns an empty list when no matching cameras are found.

GetPaginatedCameras(PaginationFilter)

Retrieves a paginated, fluent queryable collection of cameras based on the supplied pagination filter.

IFindFluent<Camera, Camera> GetPaginatedCameras(PaginationFilter request)

Parameters

request PaginationFilter

The pagination filter containing the page number and page size used to page the camera results.

Returns

IFindFluent<Camera, Camera>

An MongoDB.Driver.IFindFluent<TDocument, TProjection> representing the paged query of cameras.

GetSearchByNameCameras(string)

Asynchronously searches for cameras whose name matches the specified text.

Task<List<Camera>> GetSearchByNameCameras(string textToSearch)

Parameters

textToSearch string

The text used to filter cameras by name.

Returns

Task<List<Camera>>

A task that represents the asynchronous operation, containing a list of Camera objects matching the search criteria.

InsertOneCamera(Camera)

Inserts a new camera record into the data store and returns the persisted entity, or null if the camera could not be inserted.

Task<Camera?> InsertOneCamera(Camera camera)

Parameters

camera Camera

The Camera instance containing the data to be inserted.

Returns

Task<Camera>

A Task<TResult> that resolves to the inserted Camera, or null when the insertion is not performed.

UpdateCameraAsync(ObjectId, Camera)

Asynchronously updates an existing camera identified by the specified object identifier.

Task<Camera?> UpdateCameraAsync(ObjectId objectId, Camera camera)

Parameters

objectId ObjectId

The unique identifier of the camera to update.

camera Camera

The camera object containing the updated information.

Returns

Task<Camera>

A task that represents the asynchronous update operation. The task result contains the updated Camera, or null if no camera with the specified identifier was found.