Quantcast
Channel: Project Customization and Programming forum
Viewing all articles
Browse latest Browse all 5347

In CSOM, is there a way to only read a select few properties of an EnterpriseResource?

$
0
0

In every example it seems like they query for the properties of the whole object and then filter from there.

I really want a way to query for only two properties of the EnterpriseResources. The name and the ID.

Otherwise, when you make a call to get all the resources it ends up taking 10 or more seconds at around 8000 resources.

Here is some code that I've been trying to play around with:

var resourceCollection = projContext.LoadQuery(projContext.EnterpriseResources.Where(x => x.IsGeneric);

projContext.ExecuteQuery();

From here I want to add a select statement to the end similar to : .Select(x => x.Name, x => x.Id)

I tried instantiating a new EnterpriseResource in the Select statement but not quite sure how to. I know it needs a ClientContext and an ObjectPath. I don't know what ObjectPath it wants.

If selecting only a few properties directly in the query is not possible please let me know.


Viewing all articles
Browse latest Browse all 5347

Trending Articles



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