32 lines
959 B
C#
32 lines
959 B
C#
using Dapper;
|
|
using Microsoft.Data.SqlClient;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Shared.DTO.Envios_DGA;
|
|
using Shared.Utils.Variables_Entorno;
|
|
using System.Data;
|
|
|
|
namespace DAL
|
|
{
|
|
public class MedicionScadaRepository
|
|
{
|
|
private readonly IConfiguration _configuration;
|
|
private readonly BD_Conexion _bdConexion;
|
|
|
|
public MedicionScadaRepository(IConfiguration configuration,BD_Conexion bdConexion)
|
|
{
|
|
_configuration = configuration;
|
|
_bdConexion = bdConexion;
|
|
}
|
|
|
|
public async Task<List<MedicionScada>> ObtenerMedicionesAsync()
|
|
{
|
|
await using var connection = new SqlConnection(_bdConexion.stringConnection);
|
|
|
|
var result = await connection.QueryAsync<MedicionScada>(
|
|
"SP_OBTENER_MEDICION_SMARTSCADA_OPERACION",
|
|
commandType: CommandType.StoredProcedure);
|
|
|
|
return result.ToList();
|
|
}
|
|
}
|
|
}
|