Implement IRequest for CreateDocStatusCommand and add CreateDocStatusCommandHandler to enable MediatR request handling. Add necessary using directives and support repository injection in the handler.
31 lines
884 B
C#
31 lines
884 B
C#
using DigitalData.Core.Abstraction.Application.Repository;
|
|
using EnvelopeGenerator.Application.Common.Commands;
|
|
using EnvelopeGenerator.Domain.Entities;
|
|
using MediatR;
|
|
|
|
namespace EnvelopeGenerator.Application.DocStatus.Commands;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public record CreateDocStatusCommand : ModifyDocStatusCommandBase, IRequest<DocumentStatus>
|
|
{
|
|
/// <summary>
|
|
/// Gets timestamp when this record was added. Returns the StatusChangedWhen value.
|
|
/// </summary>
|
|
public DateTime AddedWhen => StatusChangedWhen;
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public class CreateDocStatusCommandHandler : CreateCommandHandler<CreateDocStatusCommand, DocumentStatus>
|
|
{
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="repository"></param>
|
|
public CreateDocStatusCommandHandler(IRepository<DocumentStatus> repository) : base(repository)
|
|
{
|
|
}
|
|
} |