=== Summary: 675 files | 7 generated | 484 fresh | 4605 untracked | 4268 adopted | 355 marked | 466 validated-ok | 2+0 stale (sig+body) | 0 skipped | 0 failed | elapsed 11:08:11.442 (40091.44s) ===
This commit is contained in:
@@ -12,6 +12,7 @@ namespace adas_core.Infrastructure.Repositories;
|
||||
/// <summary>
|
||||
/// Repository for managing display card configurations in MongoDB. Provides methods to perform CRUD operations on CardConfig documents.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=12ef408 -->
|
||||
public class DisplayCardConfigRepository : MongoRepository<CardConfig>, IDisplayCardConfigRepository
|
||||
{
|
||||
private readonly ApiSettings _apiSettings;
|
||||
@@ -23,6 +24,7 @@ public class DisplayCardConfigRepository : MongoRepository<CardConfig>, IDisplay
|
||||
/// <param name="database">The MongoDB database instance.</param>
|
||||
/// <param name="apiSettings">The API settings containing configuration for the repository.</param>
|
||||
/// <param name="logger">The logger instance for logging repository operations.</param>
|
||||
/// <!-- aidoc:v1 sig=0e57fcf body=7dde119 -->
|
||||
public DisplayCardConfigRepository(
|
||||
IMongoDatabase database,
|
||||
ApiSettings apiSettings,
|
||||
@@ -37,6 +39,7 @@ public class DisplayCardConfigRepository : MongoRepository<CardConfig>, IDisplay
|
||||
/// Gets the name of the MongoDB collection for CardConfig documents, as specified in the API settings.
|
||||
/// </summary>
|
||||
/// <returns>The name of the MongoDB collection for CardConfig documents.</returns>
|
||||
/// <!-- aidoc:v1 sig=94e22ff body=9fe3e35 -->
|
||||
public override string GetCollectionName()
|
||||
{
|
||||
return _apiSettings.DisplayCardConfig;
|
||||
@@ -46,6 +49,8 @@ public class DisplayCardConfigRepository : MongoRepository<CardConfig>, IDisplay
|
||||
/// Retrieves all CardConfig documents from the MongoDB collection and returns them as a list. Logs any exceptions that occur during the retrieval process.
|
||||
/// </summary>
|
||||
/// <returns>A task representing the asynchronous operation, containing a list of all CardConfig documents.</returns>
|
||||
/// <!-- aidoc-review:v1 severity=high kind=mentions_removed_behavior
|
||||
/// "Summary claims the method 'Logs any exceptions that occur during the retrieval process,' but the code body contains no exception handling or logging." -->
|
||||
public async Task<List<CardConfig>> GetAll()
|
||||
{
|
||||
var result = await Collection.Find(Builders<CardConfig>.Filter.Empty).ToListAsync();
|
||||
@@ -57,6 +62,7 @@ public class DisplayCardConfigRepository : MongoRepository<CardConfig>, IDisplay
|
||||
/// </summary>
|
||||
/// <param name="configId">The unique identifier of the CardConfig document.</param>
|
||||
/// <returns>A task representing the asynchronous operation, containing the CardConfig document if found, or null if not found or an error occurs.</returns>
|
||||
/// <!-- aidoc:v1 sig=f4374bb body=2b6bbf9 -->
|
||||
public async Task<CardConfig?> GetById(ObjectId configId)
|
||||
{
|
||||
try
|
||||
@@ -76,6 +82,7 @@ public class DisplayCardConfigRepository : MongoRepository<CardConfig>, IDisplay
|
||||
/// </summary>
|
||||
/// <param name="config">The CardConfig document to insert.</param>
|
||||
/// <returns>A task representing the asynchronous operation, containing the inserted CardConfig document if successful, or null if an error occurs.</returns>
|
||||
/// <!-- aidoc:v1 sig=2193380 body=b92e5d6 -->
|
||||
public async Task<CardConfig?> InsertOneAsyncAndReturn(CardConfig config)
|
||||
{
|
||||
try
|
||||
@@ -98,6 +105,7 @@ public class DisplayCardConfigRepository : MongoRepository<CardConfig>, IDisplay
|
||||
/// </summary>
|
||||
/// <param name="config">The CardConfig document to update.</param>
|
||||
/// <returns>A task representing the asynchronous operation, containing an UpdateResponse with the number of modified documents and the updated document.</returns>
|
||||
/// <!-- aidoc:v1 sig=5309b51 body=5aadf60 -->
|
||||
public async Task<UpdateResponse<CardConfig?>> UpdateOne(CardConfig? config)
|
||||
{
|
||||
try
|
||||
@@ -124,6 +132,7 @@ public class DisplayCardConfigRepository : MongoRepository<CardConfig>, IDisplay
|
||||
/// </summary>
|
||||
/// <param name="configId">The unique identifier of the CardConfig document to delete.</param>
|
||||
/// <returns>A task representing the asynchronous operation, containing the deleted CardConfig document if successful, or null if not found or an error occurs.</returns>
|
||||
/// <!-- aidoc:v1 sig=b415d24 body=47fbf6b -->
|
||||
public async Task<CardConfig?> DeleteOne(ObjectId configId)
|
||||
{
|
||||
return await DeleteAsync(configId);
|
||||
@@ -136,6 +145,7 @@ public class DisplayCardConfigRepository : MongoRepository<CardConfig>, IDisplay
|
||||
/// <param name="resultId">The unique identifier of the result.</param>
|
||||
/// <returns>A task representing the asynchronous operation, containing the updated CardConfig document if successful, or null if not found or an error occurs. </returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
/// <!-- aidoc:v1 sig=385c445 body=bfa6f2f -->
|
||||
public Task<object> UpdateCardConfigId(ObjectId? displayConfigId, ObjectId? resultId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
||||
Reference in New Issue
Block a user