Quantcast
Channel: (where in) no Linq
Viewing all articles
Browse latest Browse all 17

(where in) no Linq

$
0
0

Marcos faz o seguinte, aí a consulta no banco será com in, e ele trará só aqueles que estão na lista:

List<int> ids = new List<int>(){1, 2};

var varEmployee = from emin ef.Employee.AsQueryable()

              where ids.Contains(em.EmployeeID)
              selectnew
               {
                 ID = em.EmployeeID,
                 SalesPerson = em.SalesPerson
               };

Agora voê ganha de todas as maneiras :)


Viewing all articles
Browse latest Browse all 17

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>