Aktualisieren den Standardwert für apiVersion auf 1
This commit is contained in:
parent
57b273cde4
commit
02b4aa342a
@ -19,7 +19,7 @@ public static class GetExtensions
|
||||
/// <returns>
|
||||
/// A task that represents the asynchronous operation. The task result contains the matching <see cref="Article"/>, or <c>null</c> if not found.
|
||||
/// </returns>
|
||||
public static async Task<Article?> GetArticleByIdAsync(this IMediator mediator, int id, int? apiVersion = null)
|
||||
public static async Task<Article?> GetArticleByIdAsync(this IMediator mediator, int id, int apiVersion = 1)
|
||||
{
|
||||
var articles = await mediator.Send(new GetRequest(id) { ApiVersion = apiVersion });
|
||||
return articles.FirstOrDefault();
|
||||
@ -34,7 +34,7 @@ public static class GetExtensions
|
||||
/// <returns>
|
||||
/// The matching <see cref="Article"/>, or <c>null</c> if not found.
|
||||
/// </returns>
|
||||
public static Article? GetArticleById(this IMediator mediator, int id, int? apiVersion = null)
|
||||
public static Article? GetArticleById(this IMediator mediator, int id, int apiVersion = 1)
|
||||
{
|
||||
var articles = mediator.Send(new GetRequest(id) { ApiVersion = apiVersion }).GetAwaiter().GetResult();
|
||||
return articles.FirstOrDefault();
|
||||
@ -52,7 +52,7 @@ public static class GetExtensions
|
||||
/// <returns>
|
||||
/// A task that represents the asynchronous operation. The task result contains a collection of all available <see cref="Article"/> entities.
|
||||
/// </returns>
|
||||
public static Task<IEnumerable<Article>> GetAllArticlesAsync(this IMediator mediator, int? apiVersion = null) => mediator.Send(new GetRequest()
|
||||
public static Task<IEnumerable<Article>> GetAllArticlesAsync(this IMediator mediator, int apiVersion = 1) => mediator.Send(new GetRequest()
|
||||
{
|
||||
ApiVersion = apiVersion
|
||||
});
|
||||
@ -65,7 +65,7 @@ public static class GetExtensions
|
||||
/// <returns>
|
||||
/// A collection of all available <see cref="Article"/> entities.
|
||||
/// </returns>
|
||||
public static IEnumerable<Article> GetAllArticles(this IMediator mediator, int? apiVersion = null) => mediator.Send(new GetRequest()
|
||||
public static IEnumerable<Article> GetAllArticles(this IMediator mediator, int apiVersion = 1) => mediator.Send(new GetRequest()
|
||||
{
|
||||
ApiVersion = apiVersion
|
||||
}).GetAwaiter().GetResult();
|
||||
|
||||
@ -15,7 +15,7 @@ public static class PostExtensions
|
||||
/// <param name="article">The <see cref="Article"/> entity to be created.</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 CreateArticleAsync(this IMediator mediator, Article article, int? apiVersion = null) => mediator.Send(new PostRequest(article)
|
||||
public static Task CreateArticleAsync(this IMediator mediator, Article article, int apiVersion = 1) => mediator.Send(new PostRequest(article)
|
||||
{
|
||||
ApiVersion = apiVersion
|
||||
});
|
||||
@ -26,7 +26,7 @@ public static class PostExtensions
|
||||
/// <param name="mediator">The <see cref="IMediator"/> instance used to send the request.</param>
|
||||
/// <param name="article">The <see cref="Article"/> entity to be created.</param>
|
||||
/// <param name="apiVersion">Optional API version to include in the request.</param>
|
||||
public static void CreateArticle(this IMediator mediator, Article article, int? apiVersion = null) => mediator.Send(new PostRequest(article)
|
||||
public static void CreateArticle(this IMediator mediator, Article article, int apiVersion = 1) => mediator.Send(new PostRequest(article)
|
||||
{
|
||||
ApiVersion = apiVersion
|
||||
}).GetAwaiter().GetResult();
|
||||
|
||||
@ -15,7 +15,7 @@ public static class PutExtensions
|
||||
/// <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)
|
||||
public static Task UpdateArticleAsync(this IMediator mediator, Article article, int apiVersion = 1) => mediator.Send(new PutRequest(article)
|
||||
{
|
||||
ApiVersion = apiVersion
|
||||
});
|
||||
@ -26,7 +26,7 @@ public static class PutExtensions
|
||||
/// <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>
|
||||
public static void UpdateArticle(this IMediator mediator, Article article, int? apiVersion = null) => mediator.Send(new PutRequest(article)
|
||||
public static void UpdateArticle(this IMediator mediator, Article article, int apiVersion = 1) => mediator.Send(new PutRequest(article)
|
||||
{
|
||||
ApiVersion = apiVersion
|
||||
}).GetAwaiter().GetResult();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user