using CH.Dal; using Microsoft.EntityFrameworkCore; using OpenHarbor.CQRS.Abstractions; namespace CH.CQRS.Query.EnergyProvider; public class EnergyProviderQuery { } public class EnergyProviderQueryHandler(CHDbContext dbContext) : IQueryHandler { public async Task HandleAsync(EnergyProviderQuery query, CancellationToken cancellationToken = new CancellationToken()) { var energyProviders = await dbContext.EnergyProviders.ToListAsync(cancellationToken); var energyProviderQueryResult = new EnergyProviderQueryResult { Data = energyProviders }; return energyProviderQueryResult; } }