diff --git a/EnvelopeGenerator.Application/Common/Extensions/TaskExtensions.cs b/EnvelopeGenerator.Application/Common/Extensions/TaskExtensions.cs
index a07f9706..7360675c 100644
--- a/EnvelopeGenerator.Application/Common/Extensions/TaskExtensions.cs
+++ b/EnvelopeGenerator.Application/Common/Extensions/TaskExtensions.cs
@@ -5,6 +5,7 @@ namespace EnvelopeGenerator.Application.Common.Extensions;
///
/// Extension methods for tasks
///
+[Obsolete("Implement Mediator behaviors in the Osolete .NET project.")]
public static class TaskExtensions
{
///
@@ -17,6 +18,7 @@ public static class TaskExtensions
/// Exception provider
/// The awaited result if not null.
/// Thrown if the result is null.
+ [Obsolete("Implement Mediator behaviors in the Osolete .NET project.")]
public static async Task ThrowIfNull(this Task task, Func factory) where TException : Exception
{
var result = await task;
@@ -33,6 +35,7 @@ public static class TaskExtensions
/// Exception provider
/// The awaited collection if it is not null or empty.
/// Thrown if the result is null or empty.
+ [Obsolete("Implement Mediator behaviors in the Osolete .NET project.")]
public static async Task> ThrowIfEmpty(this Task> task, Func factory) where TException : Exception
{
var result = await task;
@@ -47,32 +50,46 @@ public static class TaskExtensions
///
///
///
+ [Obsolete("Implement Mediator behaviors in the Osolete .NET project.")]
public static async Task Then(this Task task, Func act)
{
var res = await task;
return act(res);
}
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ [Obsolete("Implement Mediator behaviors in the Osolete .NET project.")]
+ public static Task FirstOrDefaultAsync(this Task> task) => task.Then(t => t.FirstOrDefault());
}
///
///
///
+[Obsolete("Implement Mediator behaviors in the Osolete .NET project.")]
public static class Exceptions
{
///
///
///
+ [Obsolete("Implement Mediator behaviors in the Osolete .NET project.")]
public static NotFoundException NotFound() => new();
///
///
///
///
+ [Obsolete("Implement Mediator behaviors in the Osolete .NET project.")]
public static BadRequestException BadRequest() => new();
///
///
///
///
+ [Obsolete("Implement Mediator behaviors in the Osolete .NET project.")]
public static ForbiddenException Forbidden() => new();
}
\ No newline at end of file