22 lines
760 B
C#
22 lines
760 B
C#
using CH.Dal;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using OpenHarbor.CQRS.Abstractions;
|
|
|
|
namespace CH.CQRS.Query.EnergyRateException;
|
|
|
|
public class EnergyRateExceptionQuery
|
|
{
|
|
|
|
}
|
|
public class EnergyRateExceptionQueryHandler(CHDbContext dbContext) : IQueryHandler<EnergyRateExceptionQuery, EnergyRateExceptionQueryResult>
|
|
{
|
|
public async Task<EnergyRateExceptionQueryResult> HandleAsync(EnergyRateExceptionQuery query, CancellationToken cancellationToken = new CancellationToken())
|
|
{
|
|
var energyRateExceptions = await dbContext.EnergyRateExceptions.ToListAsync(cancellationToken);
|
|
var energyRateExceptionsQueryResult = new EnergyRateExceptionQueryResult
|
|
{
|
|
Data = energyRateExceptions,
|
|
};
|
|
return energyRateExceptionsQueryResult;
|
|
}
|
|
} |