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

34 lines
1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using Ultimus.Utilitarios;
using ULA.Cathay.CreditoModel.Credito;
namespace ULA.Cathay.CreditoModel.DAL.Credito
{
public class CondicionesGeneralesCreditoDAL
{
UltimusLogs logs = new UltimusLogs("CondicionesGeneralesCreditoDAL");
/// <summary>
///
/// </summary>
/// <returns></returns>
public ICollection<CondicionesGeneralesCredito> Obtener(int? IdTipoCondicion = null)
{
ICollection<CondicionesGeneralesCredito> _model = null;
try
{
using (CreditoContex db = new CreditoContex())
_model = db.CondicionesGeneralesCredito
.Where(x => ( ((IdTipoCondicion == null) || (x.IdTipoCondicion == IdTipoCondicion)) && x.Habilitado ) ).ToList();
}
catch (Exception ex)
{
logs.Error(ex);
throw ex;
}
return _model;
}
}
}