refactor(extensions): getrennt nach http-Methoden.
- Kommentare zur Dokumentation hinzugefügt.
This commit is contained in:
23
src/Leanetec.EConnect.Client/Articles/PutExtensions.cs
Normal file
23
src/Leanetec.EConnect.Client/Articles/PutExtensions.cs
Normal 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
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user