This example creates a SharePoint list and updates it using the ListCreationInformation class.
Like WebCreationInformation it also inherits from class ClientValueObject of Namespace Microsoft.SharePoint.Client
// Starting with ClientContext, the constructor requires a URL to the
// server running SharePoint.
ClientContext context = new ClientContext("http://SiteUrl");
// The SharePoint web at the URL.
Web web = context.Web;
ListCreationInformation creationInfo = new ListCreationInformation();
creationInfo.Title = "My List";
creationInfo.TemplateType = (int)ListTemplateType.Announcements;
List list = web.Lists.Add(creationInfo);
list.Description = "New Description";
list.Update();
context.ExecuteQuery();
No comments:
Post a Comment