Umbenennung der Then-Methoden für Konsistenz zu ThenAsync

This commit is contained in:
Developer 02 2024-05-02 17:53:18 +02:00
parent eca0e34740
commit f72b6f26f3

View File

@ -72,13 +72,13 @@ namespace DigitalData.Core.DTO
return result.IsSuccess ? Try(result.Data) : Catch(result.Messages, result.Notices);
}
public static async Task<I> Then<I>(this Task<Result> tResult, Func<I> Try, Func<List<string>, List<Notice>, I> Catch)
public static async Task<I> ThenAsync<I>(this Task<Result> tResult, Func<I> Try, Func<List<string>, List<Notice>, I> Catch)
{
Result result = await tResult;
return result.IsSuccess ? Try() : Catch(result.Messages, result.Notices);
}
public static async Task<I> Then<T, I>(this Task<DataResult<T>> tResult, Func<T, I> Try, Func<List<string>, List<Notice>, I> Catch)
public static async Task<I> ThenAsync<T, I>(this Task<DataResult<T>> tResult, Func<T, I> Try, Func<List<string>, List<Notice>, I> Catch)
{
DataResult<T> result = await tResult;
return result.IsSuccess ? Try(result.Data) : Catch(result.Messages, result.Notices);