Files
BackOffice.BFF/src/BackOffice.BFF.Application/NetworkMembershipCQ/Queries/GetNetworkStatistics/GetNetworkStatisticsQueryHandler.cs
masoodafar-web fd3c17ac23
All checks were successful
Build and Deploy / build (push) Successful in 2m18s
refactor: update protobuf imports from BFF to CMS
2025-12-08 01:37:35 +03:30

24 lines
867 B
C#

using CMSMicroservice.Protobuf.Protos.NetworkMembership;
namespace BackOffice.BFF.Application.NetworkMembershipCQ.Queries.GetNetworkStatistics;
public class GetNetworkStatisticsQueryHandler : IRequestHandler<GetNetworkStatisticsQuery, GetNetworkStatisticsResponseDto>
{
private readonly IApplicationContractContext _context;
public GetNetworkStatisticsQueryHandler(IApplicationContractContext context)
{
_context = context;
}
public async Task<GetNetworkStatisticsResponseDto> Handle(GetNetworkStatisticsQuery request, CancellationToken cancellationToken)
{
var grpcRequest = new GetNetworkStatisticsRequest();
var response = await _context.NetworkMemberships.GetNetworkStatisticsAsync(grpcRequest, cancellationToken: cancellationToken);
return response.Adapt<GetNetworkStatisticsResponseDto>();
}
}