enrique_aeo
asked on
List<PaisEntity> - show some
i have this method
public List<PaisEntity> GetAllPais()
{
List<Pais> paisLista = dbContext.Pais.ToList();
List<PaisEntity> paisEntity = new List<PaisEntity>();
if (paisLista != null)
{
paisEntity = new List<PaisEntity>();
foreach (Pais pais in paisLista)
{
paisEntity.Add(new PaisEntity
{
Id = pais.PaisID,
Nombre = pais.Nombre
});
}
}
return paisEntity;
}
the data in the databse
PaisID Nombre iso
1 Peru NULL
2 Colombia NULL
3 Ecuador NULL
4 Alemania DE
5 Andorra AD
i need show PaisId IN (1,2,3)
public List<PaisEntity> GetAllPais()
{
List<Pais> paisLista = dbContext.Pais.ToList();
List<PaisEntity> paisEntity = new List<PaisEntity>();
if (paisLista != null)
{
paisEntity = new List<PaisEntity>();
foreach (Pais pais in paisLista)
{
paisEntity.Add(new PaisEntity
{
Id = pais.PaisID,
Nombre = pais.Nombre
});
}
}
return paisEntity;
}
the data in the databse
PaisID Nombre iso
1 Peru NULL
2 Colombia NULL
3 Ecuador NULL
4 Alemania DE
5 Andorra AD
i need show PaisId IN (1,2,3)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.