Integracion_DGA/DAL/MedicionDGARepository.cs

23 lines
577 B
C#
Raw Normal View History

using System.Data;
using Dapper;
2025-06-24 14:46:32 -04:00
using Microsoft.Data.SqlClient;
using Shared.DTO.Envios_DGA;
2025-07-01 09:59:59 -04:00
using Shared.DTO.VariablesEntorno;
2025-06-24 14:46:32 -04:00
namespace DAL
{
2025-07-16 20:39:24 -04:00
public class MedicionDGARepository
2025-06-24 14:46:32 -04:00
{
2025-07-16 20:39:24 -04:00
public async Task<List<DatoDGA>> ObtenerMedicionesAsync()
2025-06-24 14:46:32 -04:00
{
2025-07-01 09:59:59 -04:00
await using var connection = new SqlConnection(BdConexion.StringConnection);
2025-06-24 14:46:32 -04:00
2025-07-16 20:39:24 -04:00
var result = await connection.QueryAsync<DatoDGA>(
"SP_OBTENER_DGA_DATOS",
2025-06-24 14:46:32 -04:00
commandType: CommandType.StoredProcedure);
return result.ToList();
}
}
}