# Interface IRelayRepository

Namespace
  adas_core.Application.Repositories.Interfaces

Assembly
  adas-core.Application.dll

    public interface IRelayRepository : IMongoRepository<Relay>

Inherited Members
  IMongoRepository<Relay>.Collection
  IMongoRepository<Relay>.GetCollectionName()
  IMongoRepository<Relay>.InsertOneAsync(Relay)
  IMongoRepository<Relay>.DeleteAsync(ObjectId)
  IMongoRepository<Relay>.UpdateOneAsync(ObjectId, Relay)

Extension Methods
  NumberUtils.IsNumber(object)
  NumberUtils.ToDouble(object)
  ObjectUtils.ToStr(object?)

## Methods

### GetById(ObjectId)

Asynchronously retrieves a relay entity by its unique identifier.

    Task<Relay?> GetById(ObjectId relayId)

#### Parameters

`relayId` ObjectId

  The unique identifier of the relay to retrieve.

#### Returns

Task<Relay>

  A task that represents the asynchronous operation. The task result contains the Relay if found; otherwise, `null`.

### GetByName(string?)

Retrieves a relay by its name asynchronously, returning null if no matching relay is found.

    Task<Relay?> GetByName(string? requestRelayName)

#### Parameters

`requestRelayName` string

  The name of the relay to look up. May be null.

#### Returns

Task<Relay>

  A task that represents the asynchronous lookup. The task result contains the matching relay, or null if no relay with the specified name exists.

### GetPaginatedRelays(PaginationFilter)

Retrieves a paginated, filterable query of relays based on the specified pagination filter.

    IFindFluent<Relay, Relay> GetPaginatedRelays(PaginationFilter filter)

#### Parameters

`filter` PaginationFilter

  The pagination filter used to control paging and additional query criteria for the relay lookup.

#### Returns

IFindFluent<Relay, Relay>

  An MongoDB.Driver.IFindFluent<TDocument, TProjection> representing the paginated query that can be further refined and executed.

### GetRelayByTypeInList(List<ObjectId>, Type)

Retrieves the relays of the specified type from the provided configuration relay list.

    List<Relay> GetRelayByTypeInList(List<ObjectId> configurationRelayList, RelayEnum.Type type)

#### Parameters

`configurationRelayList` List<ObjectId>

  The list of relay object identifiers to search through.

`type` RelayEnum.Type

  The relay type used to filter the configuration relay list.

#### Returns

List<Relay>

  A list of relays matching the specified type; an empty list if no relays of that type are found.

### GetRelayInList(List<ObjectId>)

Retrieves the Relay objects that correspond to the supplied configuration relay identifiers.

    List<Relay> GetRelayInList(List<ObjectId> configurationRelayList)

#### Parameters

`configurationRelayList` List<ObjectId>

  The list of MongoDB.Bson.ObjectId values identifying the configuration relays to look up.

#### Returns

List<Relay>

  A List<T> containing the relays that match the provided configuration relay identifiers.

### InsertOneRelayAsync(Relay)

Asynchronously inserts a single Relay record and returns the inserted entity, or null if the insertion did not produce a result.

    Task<Relay?> InsertOneRelayAsync(Relay request)

#### Parameters

`request` Relay

  The Relay entity to be inserted.

#### Returns

Task<Relay>

  A task that represents the asynchronous insert operation. The result is the inserted Relay, or null when no relay is returned.

### UpdateRelayAsync(ObjectId, Relay)

Updates an existing relay identified by the specified object identifier.

    Task<Relay?> UpdateRelayAsync(ObjectId objectId, Relay relay)

#### Parameters

`objectId` ObjectId

  The unique identifier of the relay to update.

`relay` Relay

  The relay object containing the updated information.

#### Returns

Task<Relay>

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