Link to home
Start Free TrialLog in
Avatar of enrique_aeo
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)
ASKER CERTIFIED SOLUTION
Avatar of Prakash Samariya
Prakash Samariya
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial