0

I want to call all columns but except some fields. For example only base table select not include relationships.

 var _person= db.Persons.Select(x => new
            {
                x.id,
                x.Name,
                x.Surname,
                x.Age,
                ....
x.Address.City ..
            }).ToList(); 

I want to select => var _person= db.Persons.UNSelect(x => x.Address).ToList();

Unselect or Except or nondisplay ???

  • 2
    Duplicated of https://stackoverflow.com/questions/27205761/how-to-select-from-table-records-except-some-columns – Aria Dec 26 '17 at 11:31
  • *only base table select not include relationsships*: just disable lazy loading. If you want to include data like `x.Address.City`: just type it out and make your code self-explanatory. Or consider AutoMapper with flattening. – Gert Arnold Dec 26 '17 at 11:53

0 Answers0