Refactor UpdateObjectProcedure to use DTO properties
Replaced *Procedure properties in UpdateObjectProcedure with corresponding DTO types (e.g., UpdateActionDto, UpdateEndpointDto, etc.) and added the necessary DTO namespace import. This decouples the record from procedure logic, improving separation of concerns and data transfer handling.
This commit is contained in:
@@ -5,6 +5,7 @@ using Microsoft.Data.SqlClient;
|
||||
using Microsoft.Extensions.Options;
|
||||
using ReC.Application.Common.Exceptions;
|
||||
using ReC.Application.Common.Options;
|
||||
using ReC.Application.Common.Procedures.UpdateProcedure.Dto;
|
||||
using ReC.Application.EndpointAuth.Commands;
|
||||
using ReC.Application.EndpointParams.Commands;
|
||||
using ReC.Application.Endpoints.Commands;
|
||||
@@ -29,12 +30,12 @@ public record UpdateObjectProcedure : IRequest<int>
|
||||
//TODO: update to set in authentication middleware or similar, and remove from procedure properties
|
||||
internal string? ChangedWho { get; private set; } = "ReC.API";
|
||||
|
||||
public UpdateActionProcedure Action { get; set; } = new();
|
||||
public UpdateEndpointProcedure Endpoint { get; set; } = new();
|
||||
public UpdateEndpointAuthProcedure EndpointAuth { get; set; } = new();
|
||||
public UpdateProfileProcedure Profile { get; set; } = new();
|
||||
public UpdateResultProcedure Result { get; set; } = new();
|
||||
public UpdateEndpointParamsProcedure EndpointParams { get; set; } = new();
|
||||
public UpdateActionDto Action { get; set; } = new();
|
||||
public UpdateEndpointDto Endpoint { get; set; } = new();
|
||||
public UpdateEndpointAuthDto EndpointAuth { get; set; } = new();
|
||||
public UpdateProfileDto Profile { get; set; } = new();
|
||||
public UpdateResultDto Result { get; set; } = new();
|
||||
public UpdateEndpointParamsDto EndpointParams { get; set; } = new();
|
||||
}
|
||||
|
||||
public class UpdateObjectProcedureHandler(IRepository repo, IOptionsMonitor<SqlExceptionOptions> sqlExOpt) : IRequestHandler<UpdateObjectProcedure, int>
|
||||
|
||||
Reference in New Issue
Block a user