mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-07-16 17:47:22 +00:00
Moves brewery CRUD from the Service.Breweries/Infrastructure.Repository layered split into a single Features.Breweries project: MediatR commands/queries replace BreweryService, and the repository moves in alongside its own controller. Extracts Infrastructure.Sql out of Infrastructure.Repository (just the generic ADO.NET connection/base-repo plumbing) since Breweries no longer needs the rest of that project, while Auth and UserAccount repos still do until their own migration. Also fixes the API.Core and Infrastructure.Repository.Tests Dockerfiles, which were restoring against COPY destinations that didn't match the projects' actual relative paths (silently working only because of the COPY . . that followed); both now restore against Core.slnx with correctly nested paths, verified with a real docker build.
16 lines
564 B
C#
16 lines
564 B
C#
using Features.Breweries.Repository;
|
|
using MediatR;
|
|
|
|
namespace Features.Breweries.Commands.DeleteBrewery;
|
|
|
|
/// <summary>
|
|
/// Handles <see cref="DeleteBreweryCommand"/> by deleting the matching brewery post.
|
|
/// </summary>
|
|
/// <param name="repository">Repository used to delete the brewery post.</param>
|
|
public class DeleteBreweryHandler(IBreweryRepository repository)
|
|
: IRequestHandler<DeleteBreweryCommand>
|
|
{
|
|
public Task Handle(DeleteBreweryCommand request, CancellationToken cancellationToken) =>
|
|
repository.DeleteAsync(request.BreweryPostId);
|
|
}
|