Clean up and reorganize using/import statements across the solution. Remove unnecessary DTO imports from Application and Infrastructure layers, and ensure Contracts DTOs are only referenced in API and BlazorWebApp layers. No business logic is changed; these updates improve code organization, reduce coupling, and clarify architectural separation between layers.
25 lines
791 B
C#
25 lines
791 B
C#
using AutoMapper;
|
|
using DbFirst.Application.Repositories;
|
|
using DbFirst.Contracts.MassData;
|
|
using MediatR;
|
|
|
|
namespace DbFirst.Application.MassData.Queries;
|
|
|
|
public class GetAllMassDataHandler : IRequestHandler<GetAllMassDataQuery, List<MassDataReadDto>>
|
|
{
|
|
private readonly IMassDataRepository _repository;
|
|
private readonly IMapper _mapper;
|
|
|
|
public GetAllMassDataHandler(IMassDataRepository repository, IMapper mapper)
|
|
{
|
|
_repository = repository;
|
|
_mapper = mapper;
|
|
}
|
|
|
|
public async Task<List<MassDataReadDto>> Handle(GetAllMassDataQuery request, CancellationToken cancellationToken)
|
|
{
|
|
var items = await _repository.GetAllAsync(request.Skip, request.Take, cancellationToken);
|
|
return _mapper.Map<List<MassDataReadDto>>(items);
|
|
}
|
|
}
|