Does SharePoint expose a list that can be queried for list metadata as returned in List.Fields?
Background: My aim is to request only the data that I need. When I write:
// string listName = "My List"; var myFields = context.LoadQuery(context.Web.Lists.GetByTitle(listName).Fields); context.ExecuteQuery();
myFields contains 74 elements. However, I am interested in only a handful of these so I want to restrict myFields to that small subset. If I know the fields, I can add a
.Where(x => (x.Title == "Field1" || x.Title == "Field2" ...)), but if I did not know the fields of interest, how would I limit the fields returned?
All my efforts to do it with pure CSOM code have failed. I have come to the conclusion that I need to construct a CAML query, but I am interested in the metadata (Title and InternalName) and not the contents of "My List". Is it possible?