From 5a30b0ece452b29737d8ce29e5b448e2331bc159 Mon Sep 17 00:00:00 2001 From: TekH Date: Fri, 16 Jan 2026 10:36:10 +0100 Subject: [PATCH] Remove ObtainEndpointCommand and its handler Deleted the ObtainEndpointCommand, its handler, and related using directives. This command was previously used to obtain or create Endpoint entities by URI, but has been removed in favor of using a related procedure or view as indicated by its Obsolete attribute. --- .../Commands/ObtainEndpointCommand.cs.cs | 29 ------------------- 1 file changed, 29 deletions(-) delete mode 100644 src/ReC.Application/Endpoints/Commands/ObtainEndpointCommand.cs.cs diff --git a/src/ReC.Application/Endpoints/Commands/ObtainEndpointCommand.cs.cs b/src/ReC.Application/Endpoints/Commands/ObtainEndpointCommand.cs.cs deleted file mode 100644 index c681940..0000000 --- a/src/ReC.Application/Endpoints/Commands/ObtainEndpointCommand.cs.cs +++ /dev/null @@ -1,29 +0,0 @@ -using AutoMapper; -using DigitalData.Core.Abstraction.Application.Repository; -using MediatR; -using Microsoft.EntityFrameworkCore; -using ReC.Application.Common.Dto; -using ReC.Domain.Entities; - -namespace ReC.Application.Endpoints.Commands; - -[Obsolete("Use the related procedure or view.")] -public class ObtainEndpointCommand : IRequest -{ - public string Uri { get; init; } = null!; -} - -[Obsolete("Use the related procedure or view.")] -public class ObtainEndpointCommandHandler(IRepository repo, IMapper mapper) : IRequestHandler -{ - public async Task Handle(ObtainEndpointCommand request, CancellationToken cancel) - { - var endpoint = await repo.Where(e => e.Uri == request.Uri).FirstOrDefaultAsync(cancel); - - if (endpoint is not null) - return mapper.Map(endpoint); - - endpoint = await repo.CreateAsync(request, cancel); - return mapper.Map(endpoint); - } -} \ No newline at end of file