Add handler for CreateResultViewCommand with repository
Added CreateResultViewCommandHandler to process creation of ResultView entities using IRepository<ResultView>. Also updated using directives to include necessary repository and entity namespaces.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using MediatR;
|
||||
using DigitalData.Core.Abstraction.Application.Repository;
|
||||
using MediatR;
|
||||
using ReC.Application.Common.Interfaces;
|
||||
using ReC.Domain.Entities;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace ReC.Application.ResultViews.Commands;
|
||||
@@ -16,4 +18,9 @@ public class CreateResultViewCommand : IAuthScoped, IRequest
|
||||
|
||||
[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);
|
||||
}
|
||||
Reference in New Issue
Block a user