Skip to content

Commit c2b400f

Browse files
committed
2 parents fee72d8 + 2418806 commit c2b400f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/sp-add-ins/get-a-quick-overview-of-the-sharepoint-object-model.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ private string GetLocalEmployeeName()
6969
using (var clientContext = spContext.CreateUserClientContextForSPHost())
7070
{
7171
List localEmployeesList = clientContext.Web.Lists.GetByTitle("Local Employees");
72-
selectedLocalEmployee = localEmployeesList.GetItemById(listItemID);
73-
clientContext.Load(selectedLocalEmployee);
72+
localEmployee = localEmployeesList.GetItemById(listItemID);
73+
clientContext.Load(localEmployee);
7474
clientContext.ExecuteQuery();
7575
}
7676
return localEmployee["Title"].ToString();
@@ -81,7 +81,7 @@ Note the following about this method:
8181

8282
- The first two lines in the **using** block appear to get references to the list and the list item object. But actually when these lines execute in the SharePoint client-side runtime, they are simply translated into an XML format. The **ExecuteQuery** method sends that XML to the server.
8383

84-
- The **Load** method adds something extra to the message: it tells the server to send the specified object down to the client. The **ExecuteQuery** method receives this object (as JSON) and uses it to initialize the client-side `selectedLocalEmployee` variable. Subsequent client-side code then references that **ListItem** object and its members. As you can see, the next line references the value of the item's `"Title"` field. This line would have thrown an exception if the **Load** method had not been called because the object doesn't really exist on the client-side until it is loaded.
84+
- The **Load** method adds something extra to the message: it tells the server to send the specified object down to the client. The **ExecuteQuery** method receives this object (as JSON) and uses it to initialize the client-side `localEmployee` variable. Subsequent client-side code then references that **ListItem** object and its members. As you can see, the next line references the value of the item's `"Title"` field. This line would have thrown an exception if the **Load** method had not been called because the object doesn't really exist on the client-side until it is loaded.
8585

8686
## Next steps
8787
<a name="Nextsteps"> </a>

0 commit comments

Comments
 (0)