=== 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 ChartConfig in MongoDB. Provides methods to retrieve and manipulate ChartConfig data.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=22edc0e -->
|
||||
public class DisplayChartConfigRepository : MongoRepository<ChartConfig>, IDisplayChartConfigRepository
|
||||
{
|
||||
private readonly ApiSettings _apiSettings;
|
||||
@@ -24,6 +25,7 @@ public class DisplayChartConfigRepository : MongoRepository<ChartConfig>, IDispl
|
||||
/// <param name="database">The MongoDB database instance.</param>
|
||||
/// <param name="apiSettings">The API settings instance.</param>
|
||||
/// <param name="logger">The logger instance.</param>
|
||||
/// <!-- aidoc:v1 sig=9ddd533 body=7dde119 -->
|
||||
public DisplayChartConfigRepository(IMongoDatabase database, ApiSettings apiSettings,
|
||||
ILogger<DisplayChartConfigRepository> logger) : base(database)
|
||||
{
|
||||
@@ -35,6 +37,7 @@ public class DisplayChartConfigRepository : MongoRepository<ChartConfig>, IDispl
|
||||
/// Gets the name of the MongoDB collection for ChartConfig. This method retrieves the collection name from the API settings.
|
||||
/// </summary>
|
||||
/// <returns>The name of the MongoDB collection for ChartConfig.</returns>
|
||||
/// <!-- aidoc:v1 sig=94e22ff body=0d27cbe -->
|
||||
public override string GetCollectionName()
|
||||
{
|
||||
return _apiSettings.DisplayChartConfig;
|
||||
@@ -44,6 +47,7 @@ public class DisplayChartConfigRepository : MongoRepository<ChartConfig>, IDispl
|
||||
/// Retrieves all ChartConfig documents from the MongoDB collection. This method returns a list of ChartConfig objects representing all the configurations stored in the database.
|
||||
/// </summary>
|
||||
/// <returns>A list of ChartConfig objects representing all the configurations stored in the database.</returns>
|
||||
/// <!-- aidoc:v1 sig=c0c01a0 body=014de50 -->
|
||||
public async Task<List<ChartConfig>> GetAll()
|
||||
{
|
||||
var result = await Collection.Find(Builders<ChartConfig>.Filter.Empty).ToListAsync();
|
||||
@@ -55,6 +59,7 @@ public class DisplayChartConfigRepository : MongoRepository<ChartConfig>, IDispl
|
||||
/// </summary>
|
||||
/// <param name="configId">The unique identifier of the ChartConfig document.</param>
|
||||
/// <returns>The ChartConfig object if found, or null if no matching document is found.</returns>
|
||||
/// <!-- aidoc:v1 sig=6225aa4 body=e406da3 -->
|
||||
public async Task<ChartConfig?> GetById(ObjectId configId)
|
||||
{
|
||||
try
|
||||
@@ -75,6 +80,7 @@ public class DisplayChartConfigRepository : MongoRepository<ChartConfig>, IDispl
|
||||
/// </summary>
|
||||
/// <param name="config">The ChartConfig object to be inserted into the MongoDB collection.</param>
|
||||
/// <returns>The inserted ChartConfig object if successful, or null if an error occurs.</returns>
|
||||
/// <!-- aidoc:v1 sig=14ecb27 body=b92e5d6 -->
|
||||
public async Task<ChartConfig?> InsertOneAsyncAndReturn(ChartConfig config)
|
||||
{
|
||||
try
|
||||
@@ -97,6 +103,7 @@ public class DisplayChartConfigRepository : MongoRepository<ChartConfig>, IDispl
|
||||
/// </summary>
|
||||
/// <param name="config">The ChartConfig object containing the updated data.</param>
|
||||
/// <returns>An UpdateResponse object containing the number of changes made and the updated ChartConfig document.</returns>
|
||||
/// <!-- aidoc:v1 sig=6322c8a body=dcdf910 -->
|
||||
public async Task<UpdateResponse<ChartConfig?>> UpdateOne(ChartConfig? config)
|
||||
{
|
||||
try
|
||||
@@ -129,6 +136,8 @@ public class DisplayChartConfigRepository : MongoRepository<ChartConfig>, IDispl
|
||||
/// </summary>
|
||||
/// <param name="configId">ChartConfig Id to be deleted </param>
|
||||
/// <returns></returns>
|
||||
/// <!-- aidoc-review:v1 severity=low kind=missing_returns
|
||||
/// "<returns> tag is empty; method returns Task<ChartConfig?> (the deleted ChartConfig or null)" -->
|
||||
public async Task<ChartConfig?> DeleteOne(ObjectId configId)
|
||||
{
|
||||
return await DeleteAsync(configId);
|
||||
|
||||
Reference in New Issue
Block a user