Client
|
Server
|
Notice that the SharePoint
Foundation 2010 managed client object model uses the same legacy naming pattern
for site collections and sites as the server object model.
The Site class represents site collections, and the Web class represents sites.
My preference for using
these classes is to name the variables so that the variable name indicates
whether it is a site collection or a site, even though you must use the Site and Web classes to declare them.
The following example shows how name
variables.
C#
ClientContext clientContext = new ClientContext(siteUrl);
Site siteCollection = clientContext.Site;
Web site = clientContext.Web;
No comments:
Post a Comment