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

33 lines
845 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 GrupoCIIUDAL
{
private UltimusLogs logger = new UltimusLogs("GrupoCIIUDAL");
public GrupoCIIU Obtener(string IdGrupoCiiu)
{
GrupoCIIU respuesta = new GrupoCIIU();
try
{
using (CreditoContex db = new CreditoContex())
{
respuesta = db.GrupoCIIU.Where(x => x.IdGrupoCIIU == IdGrupoCiiu).Include(x => x.Sector).First();
}
}
catch (Exception ex)
{
logger.Error(ex);
return respuesta = null;
}
return respuesta;
}
}
}