refactor(extensions): getrennt nach http-Methoden.

- Kommentare zur Dokumentation hinzugefügt.
This commit is contained in:
2025-07-09 09:23:19 +02:00
parent 7fea71c08d
commit 7d575398c6
4 changed files with 48 additions and 25 deletions

View File

@@ -0,0 +1,23 @@
using Leanetec.EConnect.Domain.Entities;
using MediatR;
namespace Leanetec.EConnect.Client.Articles;
/// <summary>
/// Extension methods for the <see cref="IMediator"/> interface to simplify working with <see cref="Article"/> entities.
/// </summary>
public static class PutExtensions
{
/// <summary>
/// Sends a request to update an existing <see cref="Article"/> using MediatR.
/// </summary>
/// <param name="mediator">The <see cref="IMediator"/> instance used to send the request.</param>
/// <param name="article">The <see cref="Article"/> entity to be updated.</param>
/// <param name="apiVersion">Optional API version to include in the request.</param>
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
public static Task UpdateArticleAsync(this IMediator mediator, Article article, int? apiVersion = null) =>
mediator.Send(new PutRequest(article)
{
ApiVersion = apiVersion
});
}