diff --git a/src/ReC.Application/Profile/Commands/UpdateProfileProcedure.cs b/src/ReC.Application/Profile/Commands/UpdateProfileProcedure.cs index 74d7fa6..072e335 100644 --- a/src/ReC.Application/Profile/Commands/UpdateProfileProcedure.cs +++ b/src/ReC.Application/Profile/Commands/UpdateProfileProcedure.cs @@ -1,9 +1,11 @@ +using MediatR; using ReC.Application.Common.Procedures.UpdateProcedure; namespace ReC.Application.Profile.Commands; public record UpdateProfileProcedure : IUpdateProcedure { + public long Id { get; set; } public bool? Active { get; set; } public byte? TypeId { get; set; } public string? Mandantor { get; set; } @@ -14,14 +16,17 @@ public record UpdateProfileProcedure : IUpdateProcedure public DateTime? FirstRun { get; set; } public DateTime? LastRun { get; set; } public string? LastResult { get; set; } +} - public UpdateObjectProcedure ToObjectProcedure(long id, string? changedWho = null) +public class UpdateProfileProcedureHandler(ISender sender) : IRequestHandler +{ + public async Task Handle(UpdateProfileProcedure request, CancellationToken cancel) { - return new UpdateObjectProcedure + return await sender.Send(new UpdateObjectProcedure { Entity = "PROFILE", - Id = id, - Profile = this - }.ChangedBy(changedWho); + Id = request.Id, + Profile = request + }, cancel); } -} +} \ No newline at end of file