using DbFirst.Application.Repositories;
using MediatR;

namespace DbFirst.Application.MassData.Queries;

public class GetMassDataCountHandler : IRequestHandler<GetMassDataCountQuery, int>
{
    private readonly IMassDataRepository _repository;

    public GetMassDataCountHandler(IMassDataRepository repository)
    {
        _repository = repository;
    }

    public async Task<int> Handle(GetMassDataCountQuery request, CancellationToken cancellationToken)
    {
        return await _repository.GetCountAsync(cancellationToken);
    }
}
