33 lines
1.2 KiB
C#
33 lines
1.2 KiB
C#
using EnvelopeGenerator.Application.Dto.EnvelopeReceiver;
|
|
using MediatR;
|
|
|
|
namespace EnvelopeGenerator.Application.Common.Notifications;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="Original"></param>
|
|
public record DocSignedNotification(EnvelopeReceiverDto Original) : EnvelopeReceiverDto(Original), INotification
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public static class DocSignedNotificationExtensions
|
|
{
|
|
/// <summary>
|
|
/// Converts an <see cref="EnvelopeReceiverDto"/> to a <see cref="DocSignedNotification"/>.
|
|
/// </summary>
|
|
/// <param name="dto">The DTO to convert.</param>
|
|
/// <returns>A new <see cref="DocSignedNotification"/> instance.</returns>
|
|
public static DocSignedNotification ToDocSignedNotification(this EnvelopeReceiverDto dto) => new (dto);
|
|
|
|
/// <summary>
|
|
/// Asynchronously converts a <see cref="Task{EnvelopeReceiverDto}"/> to a <see cref="DocSignedNotification"/>.
|
|
/// </summary>
|
|
/// <param name="dtoTask">The task that returns the DTO to convert.</param>
|
|
/// <returns>A task that represents the asynchronous conversion operation.</returns>
|
|
public static async Task<DocSignedNotification> ToDocSignedNotification(this Task<EnvelopeReceiverDto> dtoTask)
|
|
=> new(await dtoTask);
|
|
} |