# Class DisplayDetailConfigRepository

Namespace
  adas_core.Infrastructure.Repositories

Assembly
  adas-core.Infrastructure.dll

Repository implementation for managing CardDetailsConfig entities in MongoDB. Provides CRUD operations for display detail configurations used in nurse and smart displays.

    public class DisplayDetailConfigRepository : MongoRepository<CardDetailsConfig>, IDisplayDetailConfigRepository, IMongoRepository<CardDetailsConfig>

Inheritance
  object
  MongoRepository<CardDetailsConfig>
  DisplayDetailConfigRepository

Implements
  IDisplayDetailConfigRepository
  IMongoRepository<CardDetailsConfig>

Inherited Members
  MongoRepository<CardDetailsConfig>.Db
  MongoRepository<CardDetailsConfig>.Collection
  MongoRepository<CardDetailsConfig>.InsertOneAsync(CardDetailsConfig)
  MongoRepository<CardDetailsConfig>.UpdateOneAsync(ObjectId, CardDetailsConfig)
  MongoRepository<CardDetailsConfig>.DeleteAsync(ObjectId)
  MongoRepository<CardDetailsConfig>.CreateIndexes()
  MongoRepository<CardDetailsConfig>.InsertInitialLoad()
  MongoRepository<CardDetailsConfig>.InsertManyAsync(List<CardDetailsConfig>)
  MongoRepository<CardDetailsConfig>.UpdateManyObjectIdAsync(string, ObjectId, ObjectId)
  MongoRepository<CardDetailsConfig>.DeleteAsync(string)
  MongoRepository<CardDetailsConfig>.CollectionExists(string)
  object.Equals(object)
  object.Equals(object, object)
  object.GetHashCode()
  object.GetType()
  object.MemberwiseClone()
  object.ReferenceEquals(object, object)
  object.ToString()

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

## Constructors

### DisplayDetailConfigRepository(IMongoDatabase, ApiSettings, ILogger<DisplayDetailConfigRepository>)

Initializes a new instance of the DisplayDetailConfigRepository.

    public DisplayDetailConfigRepository(IMongoDatabase database, ApiSettings apiSettings, ILogger<DisplayDetailConfigRepository> logger)

#### Parameters

`database` IMongoDatabase

  The MongoDB database instance.

`apiSettings` ApiSettings

  API settings containing collection names configuration.

`logger` ILogger<DisplayDetailConfigRepository>

  Logger for repository operations.

## Methods

### DeleteOne(ObjectId)

Deletes a display detail configuration by its ID.

    public Task<CardDetailsConfig?> DeleteOne(ObjectId configId)

#### Parameters

`configId` ObjectId

  The ObjectId of the configuration to delete.

#### Returns

Task<CardDetailsConfig>

  The deleted CardDetailsConfig if found; otherwise, null.

### GetAll()

Retrieves all display detail configurations from the database.

    public Task<List<CardDetailsConfig>> GetAll()

#### Returns

Task<List<CardDetailsConfig>>

  A list of all CardDetailsConfig entities.

### GetById(ObjectId)

Retrieves a display detail configuration by its ID.

    public Task<CardDetailsConfig?> GetById(ObjectId configId)

#### Parameters

`configId` ObjectId

  The ObjectId of the detail configuration to retrieve.

#### Returns

Task<CardDetailsConfig>

  The CardDetailsConfig if found; otherwise, null.

#### Exceptions

Exception

  Throws an exception if MongoDB query fails; returns null instead.

### GetCollectionName()

Gets the name of the collection for display detail configurations.

    public override string GetCollectionName()

#### Returns

string

  The collection name from API settings.

### InsertOneAsyncAndReturn(CardDetailsConfig)

Inserts a new display detail configuration and returns the inserted document.

    public Task<CardDetailsConfig?> InsertOneAsyncAndReturn(CardDetailsConfig config)

#### Parameters

`config` CardDetailsConfig

  The CardDetailsConfig to insert.

#### Returns

Task<CardDetailsConfig>

  The inserted CardDetailsConfig, or null if insertion fails.

### UpdateCardConfigId(ObjectId?, ObjectId?)

Updates the display configuration ID reference. This method is not implemented.

    public Task<object> UpdateCardConfigId(ObjectId? displayConfigId, ObjectId? resultId)

#### Parameters

`displayConfigId` ObjectId?

  The ObjectId of the display configuration.

`resultId` ObjectId?

  The new reference ID to set.

#### Returns

Task<object>

  Always throws NotImplementedException.

#### Exceptions

NotImplementedException

  This method is not implemented.

### UpdateOne(CardDetailsConfig?)

Updates an existing display detail configuration with new values.

    public Task<UpdateResponse<CardDetailsConfig?>> UpdateOne(CardDetailsConfig? config)

#### Parameters

`config` CardDetailsConfig

  The CardDetailsConfig with updated values.

#### Returns

Task<UpdateResponse<CardDetailsConfig>>

  An UpdateResponse containing the modified count and the updated document.

#### Exceptions

Exception

  Throws an exception if MongoDB update fails; returns UpdateResponse with null document.