HI,
requirement to read resources based on custom field value at one shot using csom. i have written a code using nested where clause in linq on context.Load Statement.but it is giving error .plz help on this.
using (ProjectContext context = new ProjectContext(uri)){
string cf = "Custom_38011a416ca5e51180eb00155d043716";
string value = "value";
context.Load(context.EnterpriseResources
);
context.ExecuteQuery();
//var q = from e in context.EnterpriseResources
// where e.FieldValues.Any(i=>i.Key==cf)
// //&& e.FieldValues.Any(f=>f.Value==value)
// select e;
var r = context.EnterpriseResources.Where(i => i.FieldValues.Any(fs => fs.Key.Equals(cf)));
foreach (EnterpriseResource er in context.EnterpriseResources)
{
Console.WriteLine(er[cf].ToString());
Console.WriteLine(er.Name);
}
}