I have the following code, to get a list item based on the ID and load specific properties only, as follow:-
CamlQuery camlQuery = new CamlQuery();
camlQuery.ViewXml = string.Format("<View Scope=\"RecursiveAll\"><Query><Where><Eq><FieldRef Name='ID' /><Value Type='Number'>{0}</Value></Eq></Where></Query></View>", listItemID);
ListItemCollection collListItem = context.Web.Lists.GetByTitle("Project Update System").GetItems(camlQuery);
context.Load(collListItem);
context.Load(collListItem,
items => items.Include(
item => item.Id,
item => item["ProjectDescription"],
item => item["ProjectOMSNumber"],
item => item["ProjectDateSinged"],
item => item["ProjectManHoursEstimated"],
item => item["ProjectStage"]
));
context.ExecuteQuery();
context.Load(collListItem);
foreach (ListItem i in collListItem)
{
f (i["ProjectSDNumber"] != null && !string.IsNullOrEmpty(i["ProjectSDNumber"].ToString()))
{
Now i thought that my above code will raise an error since i am accessing a property named ProjectSDNumber
which is not been loaded.. but my code worked without errors. so can i know what is going on?