TFS_ANTIGUO/SInCathay/ULA.Cathay.CreditoModel.DAL/Credito/MatrizBeneficiarioSBDDAL.cs

33 lines
992 B
C#

using System;
using System.Linq;
using ULA.Cathay.CreditoModel.Credito;
using Ultimus.Utilitarios;
using System.Data.Entity;
namespace ULA.Cathay.CreditoModel.DAL.Credito
{
public class MatrizBeneficiarioSBDDAL
{
private UltimusLogs logger = new UltimusLogs("MatrizBeneficiarioSBDDAL");
public MatrizBeneficiarioSBD Obtener( int IdLey8262, int IdSector)
{
MatrizBeneficiarioSBD respuesta = new MatrizBeneficiarioSBD();
try
{
using (CreditoContex db = new CreditoContex())
{
respuesta = db.MatrizBeneficiarioSBD.Where(x => x.IdLey8262 == IdLey8262 && x.IdSector== IdSector).Include(x=>x.Sector).Include(x=>x.Ley8262).Include(x=>x.BeneficiarioSBD).FirstOrDefault();
}
}
catch (Exception ex)
{
logger.Error(ex);
throw ex;
}
return respuesta;
}
}
}