Fix in variable names
This commit is contained in:
parent
0f9a4c2af2
commit
eae1e1580e
@ -38,13 +38,13 @@ namespace Core.Inventory.Provider.Providers.Inventory
|
||||
/// <summary>
|
||||
/// Changes the status of a FurnitureBase entity.
|
||||
/// </summary>
|
||||
/// <param name="id">The furniture base identifier.</param>
|
||||
/// <param name="mongoId">The furniture base identifier.</param>
|
||||
/// <param name="newStatus">The new status to apply.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
/// <returns>The updated <see cref="FurnitureBase"/>.</returns>
|
||||
public async ValueTask<FurnitureBase> ChangeStatusAsync(string id, StatusEnum newStatus, CancellationToken cancellationToken)
|
||||
public async ValueTask<FurnitureBase> ChangeStatusAsync(string mongoId, StatusEnum newStatus, CancellationToken cancellationToken)
|
||||
{
|
||||
var entity = await repository.FindByIdAsync(id);
|
||||
var entity = await repository.FindByIdAsync(mongoId);
|
||||
entity.Status = newStatus;
|
||||
await repository.ReplaceOneAsync(entity);
|
||||
return entity;
|
||||
@ -83,17 +83,17 @@ namespace Core.Inventory.Provider.Providers.Inventory
|
||||
/// <summary>
|
||||
/// Gets a FurnitureBase entity by its ID.
|
||||
/// </summary>
|
||||
/// <param name="_id">The furniture base identifier.</param>
|
||||
/// <param name="mongoId">The furniture base identifier.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
/// <returns>The corresponding <see cref="FurnitureBase"/>.</returns>
|
||||
public async ValueTask<FurnitureBase> GetByIdAsync(string _id, CancellationToken cancellationToken)
|
||||
public async ValueTask<FurnitureBase> GetByIdAsync(string mongoId, CancellationToken cancellationToken)
|
||||
{
|
||||
var cacheKey = CacheKeyHelper.GenerateCacheKey(this, nameof(GetByIdAsync), _id);
|
||||
var cacheKey = CacheKeyHelper.GenerateCacheKey(this, nameof(GetByIdAsync), mongoId);
|
||||
var cached = await cacheProvider.GetAsync<FurnitureBase>(cacheKey);
|
||||
|
||||
if (cached is not null) return cached;
|
||||
|
||||
var result = await repository.FindByIdAsync(_id);
|
||||
var result = await repository.FindByIdAsync(mongoId);
|
||||
await cacheProvider.SetAsync(cacheKey, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user