feat(envelope-reports): add extension method for reading envelope reports via ISender
This commit is contained in:
parent
8459706c45
commit
6f9b5d4b13
@ -27,6 +27,26 @@ public record ReadEnvelopeReportQuery(int EnvelopeId) : IRequest<IEnumerable<Env
|
||||
public bool ThrowIfNotFound { get; init; } = true;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static class ReadEnvelopeReportQueryExtensions
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="envelopeId"></param>
|
||||
/// <param name="throwIfNotFound"></param>
|
||||
/// <param name="cancel"></param>
|
||||
/// <returns></returns>
|
||||
public static Task<IEnumerable<EnvelopeReport>> ReadEnvelopeReportAsync(this ISender sender, int envelopeId, bool throwIfNotFound = true, CancellationToken cancel = default)
|
||||
=> sender.Send(new ReadEnvelopeReportQuery(envelopeId)
|
||||
{
|
||||
ThrowIfNotFound = throwIfNotFound
|
||||
}, cancel);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user