mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-07-16 17:47:22 +00:00
code style cleanup
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Domain.Entities;
|
||||
using Features.Breweries.Dtos;
|
||||
using Features.Breweries.Repository;
|
||||
using MediatR;
|
||||
@@ -5,7 +6,7 @@ using MediatR;
|
||||
namespace Features.Breweries.Queries.GetAllBreweries;
|
||||
|
||||
/// <summary>
|
||||
/// Handles <see cref="GetAllBreweriesQuery"/> by retrieving a paginated list of brewery posts.
|
||||
/// Handles <see cref="GetAllBreweriesQuery" /> by retrieving a paginated list of brewery posts.
|
||||
/// </summary>
|
||||
/// <param name="repository">Repository used to query brewery post data.</param>
|
||||
public class GetAllBreweriesHandler(IBreweryRepository repository)
|
||||
@@ -13,7 +14,7 @@ public class GetAllBreweriesHandler(IBreweryRepository repository)
|
||||
{
|
||||
public async Task<IEnumerable<BreweryDto>> Handle(GetAllBreweriesQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
var breweries = await repository.GetAllAsync(request.Limit, request.Offset);
|
||||
IEnumerable<BreweryPost> breweries = await repository.GetAllAsync(request.Limit, request.Offset);
|
||||
return breweries.Select(b => b.ToDto());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,6 @@ using MediatR;
|
||||
namespace Features.Breweries.Queries.GetAllBreweries;
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves a paginated list of brewery posts.
|
||||
/// Retrieves a paginated list of brewery posts.
|
||||
/// </summary>
|
||||
public record GetAllBreweriesQuery(int? Limit, int? Offset) : IRequest<IEnumerable<BreweryDto>>;
|
||||
public record GetAllBreweriesQuery(int? Limit, int? Offset) : IRequest<IEnumerable<BreweryDto>>;
|
||||
@@ -1,3 +1,4 @@
|
||||
using Domain.Entities;
|
||||
using Features.Breweries.Dtos;
|
||||
using Features.Breweries.Repository;
|
||||
using MediatR;
|
||||
@@ -5,7 +6,7 @@ using MediatR;
|
||||
namespace Features.Breweries.Queries.GetBreweryById;
|
||||
|
||||
/// <summary>
|
||||
/// Handles <see cref="GetBreweryByIdQuery"/> by looking up the matching brewery post.
|
||||
/// Handles <see cref="GetBreweryByIdQuery" /> by looking up the matching brewery post.
|
||||
/// </summary>
|
||||
/// <param name="repository">Repository used to query brewery post data.</param>
|
||||
public class GetBreweryByIdHandler(IBreweryRepository repository)
|
||||
@@ -13,7 +14,7 @@ public class GetBreweryByIdHandler(IBreweryRepository repository)
|
||||
{
|
||||
public async Task<BreweryDto?> Handle(GetBreweryByIdQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
var brewery = await repository.GetByIdAsync(request.BreweryPostId);
|
||||
BreweryPost? brewery = await repository.GetByIdAsync(request.BreweryPostId);
|
||||
return brewery?.ToDto();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,6 @@ using MediatR;
|
||||
namespace Features.Breweries.Queries.GetBreweryById;
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves a single brewery post by its unique identifier.
|
||||
/// Retrieves a single brewery post by its unique identifier.
|
||||
/// </summary>
|
||||
public record GetBreweryByIdQuery(Guid BreweryPostId) : IRequest<BreweryDto?>;
|
||||
public record GetBreweryByIdQuery(Guid BreweryPostId) : IRequest<BreweryDto?>;
|
||||
Reference in New Issue
Block a user