using CH.CQRS.Query.EnergyProvider; using CH.Dal; using Microsoft.EntityFrameworkCore; using OpenHarbor.CQRS.Abstractions; namespace CH.CQRS.Query.EnergyRate; public class EnergyRateQuery { } public class EnergyRateQueryHandler(CHDbContext dbContext) : IQueryHandler { public async Task HandleAsync(EnergyRateQuery query, CancellationToken cancellationToken = new CancellationToken()) { var energyRates = await dbContext.EnergyRates.ToListAsync(cancellationToken); var energyRateQueryResult = new EnergyRateQueryResult { Data = energyRates }; return energyRateQueryResult; } }