Umbenennung der Then-Methoden für Konsistenz zu ThenAsync
This commit is contained in:
parent
eca0e34740
commit
f72b6f26f3
@ -72,13 +72,13 @@ namespace DigitalData.Core.DTO
|
|||||||
return result.IsSuccess ? Try(result.Data) : Catch(result.Messages, result.Notices);
|
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;
|
Result result = await tResult;
|
||||||
return result.IsSuccess ? Try() : Catch(result.Messages, result.Notices);
|
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;
|
DataResult<T> result = await tResult;
|
||||||
return result.IsSuccess ? Try(result.Data) : Catch(result.Messages, result.Notices);
|
return result.IsSuccess ? Try(result.Data) : Catch(result.Messages, result.Notices);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user