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