Refactor GetOrCreateEndpointCommand to ObtainEndpointCommand

Replaced `GetOrCreateEndpointCommand` with `ObtainEndpointCommand`
to improve clarity and align with naming conventions. Removed
`GetOrCreateEndpointCommand` and its handler, and introduced
`ObtainEndpointCommand` with equivalent functionality.

Updated `MappingProfile.cs` to map `ObtainEndpointCommand` to
`Endpoint`. Refactored `CreateRecActionCommand.cs` to use the
new `ObtainEndpointCommand` for retrieving or creating `Endpoint`
entities.

These changes ensure consistent naming and maintain the same
behavior while improving code readability.
This commit is contained in:
2025-12-01 16:00:41 +01:00
parent a962299c95
commit 918372371e
3 changed files with 5 additions and 5 deletions

View File

@@ -30,7 +30,7 @@ public class CreateRecActionCommandHandler(ISender sender) : IRequestHandler<Cre
if(request.EndpointId is null)
if(request.EndpointUri is string endpointUri)
{
var endpoint = await sender.Send(new GetOrCreateEndpointCommand { Uri = endpointUri }, cancel);
var endpoint = await sender.Send(new ObtainEndpointCommand { Uri = endpointUri }, cancel);
request.EndpointId = endpoint.Id;
}
else