Selecting multiple columns in Linq

objuser = from res in _db.users

              where (res.EMAIL == givenInfo || res.USER_NAME == givenInfo)
              select res.EMAIL;

How can I select multiple columns? 

Last updated:12/14/2017 11:51:19 PM

1 Answers

Manish Kumar
Manish Kumar

You can use like this

var employee = _db.EMPLOYEEs

    .Where(x => x.EMAIL == givenInfo || x.USER_NAME == givenInfo)
    .Select(x => new { x.EMAIL, x.ID });

Hope it helps you..

Answer