refactor: Hinzufügen der synchronen Version der Methode IsAliveAsync mit XML-Dokumentation
This commit is contained in:
@@ -5,13 +5,28 @@ namespace Leanetec.EConnect.Client.Alive;
|
|||||||
public static class GetExtensions
|
public static class GetExtensions
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns true if while the application is up.
|
/// Checks if the application is alive by sending a <see cref="GetRequest"/> via MediatR.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="mediator"></param>
|
/// <param name="mediator">The MediatR instance to send the request through.</param>
|
||||||
/// <param name="role">Role of logged user</param>
|
/// <param name="role">Optional role of the logged-in user.</param>
|
||||||
/// <returns></returns>
|
/// <param name="apiVersion">Optional API version.</param>
|
||||||
public static Task<bool> IsAliveAsync(this IMediator mediator, Role? role = null, int? apiVersion = null) => mediator.Send(new GetRequest(role)
|
/// <returns>A <see cref="Task{Boolean}"/> representing whether the application is alive.</returns>
|
||||||
{
|
public static Task<bool> IsAliveAsync(this IMediator mediator, Role? role = null, int? apiVersion = null) =>
|
||||||
ApiVersion = apiVersion
|
mediator.Send(new GetRequest(role)
|
||||||
});
|
{
|
||||||
|
ApiVersion = apiVersion
|
||||||
|
});
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Checks if the application is alive by sending a <see cref="GetRequest"/> synchronously via MediatR.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mediator">The MediatR instance to send the request through.</param>
|
||||||
|
/// <param name="role">Optional role of the logged-in user.</param>
|
||||||
|
/// <param name="apiVersion">Optional API version.</param>
|
||||||
|
/// <returns>True if the application is alive; otherwise, false.</returns>
|
||||||
|
public static bool IsAlive(this IMediator mediator, Role? role = null, int? apiVersion = null) =>
|
||||||
|
mediator.Send(new GetRequest(role)
|
||||||
|
{
|
||||||
|
ApiVersion = apiVersion
|
||||||
|
}).GetAwaiter().GetResult();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user