Linq Syntax - Selecting multiple columns

后端 未结 3 1664
轮回少年
轮回少年 2020-11-29 21:24

This is my Linq Syntax which I am using to my entity model

IQueryable objEmployee = null;

objEmployee = from res in _db.EMPLOYEEs
                     


        
3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-29 22:09

    You can use anonymous types for example:

      var empData = from res in _db.EMPLOYEEs
                    where res.EMAIL == givenInfo || res.USER_NAME == givenInfo
                    select new { res.EMAIL, res.USER_NAME };
    

提交回复
热议问题