Updated CreateOutResCommandHandler to use the OutRes entity instead of the command itself in repository operations. Added a new using directive for ReC.Domain.Entities. Updated the CreateOutResCommand class to implement MediatR's IRequest interface.
24 lines
621 B
C#
24 lines
621 B
C#
using DigitalData.Core.Abstraction.Application.Repository;
|
|
using MediatR;
|
|
using ReC.Domain.Entities;
|
|
|
|
namespace ReC.Application.OutResults.Commands;
|
|
|
|
public class CreateOutResCommand : IRequest
|
|
{
|
|
public required long ActionId { get; set; }
|
|
|
|
public string? Header { get; set; }
|
|
|
|
public string? Body { get; set; }
|
|
|
|
public string? AddedWho { get; set; }
|
|
}
|
|
|
|
public class CreateOutResCommandHandler(IRepository<OutRes> repo) : IRequestHandler<CreateOutResCommand>
|
|
{
|
|
public Task Handle(CreateOutResCommand request, CancellationToken cancel)
|
|
{
|
|
return repo.CreateAsync(request, cancel);
|
|
}
|
|
} |