26 lines
779 B
C#
26 lines
779 B
C#
using DigitalData.Core.Abstraction.Application.Repository;
|
|
using MediatR;
|
|
using ReC.Application.Common.Interfaces;
|
|
using ReC.Domain.Views;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace ReC.Application.ResultViews.Commands;
|
|
|
|
public class CreateResultViewCommand : IAuthScoped, IRequest
|
|
{
|
|
public required long ActionId { get; set; }
|
|
|
|
public required short StatusCode { get; set; }
|
|
|
|
public string? Header { get; set; }
|
|
|
|
public string? Body { get; set; }
|
|
|
|
[JsonIgnore]
|
|
public AuthScope Scope { get; } = new();
|
|
}
|
|
|
|
public class CreateResultViewCommandHandler(IRepository<ResultView> repo) : IRequestHandler<CreateResultViewCommand>
|
|
{
|
|
public Task Handle(CreateResultViewCommand request, CancellationToken cancel) => repo.CreateAsync(request, cancel);
|
|
} |