Skip to content

Commit ef6bf11

Browse files
tommypage777VesaJuvonen
authored andcommitted
Update complete-basic-operations-using-sharepoint-client-library-code.md (SharePoint#2907)
1 parent 67c9b14 commit ef6bf11

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

docs/sp-add-ins/complete-basic-operations-using-sharepoint-client-library-code.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,8 @@ When a value object is returned from a method or property, you cannot use that o
658658
ClientContext context = new ClientContext("http://SiteUrl");
659659

660660
Web web = context.Web;
661-
ListCreationInformation creationInfo = new ListCreationInformation();
661+
ListCreationInformation creationInfo = new ListCreationInformation();
662+
creationInfo.TemplateType = (int)ListTemplateType.Announcements;
662663
creationInfo.Description = web.Title;
663664
creationInfo.Title = web.Title;
664665
List newList = web.Lists.Add(creationInfo);
@@ -676,11 +677,12 @@ ClientContext context = new ClientContext("http://SiteUrl");
676677

677678
Web web = context.Web;
678679

679-
context.Load(web, w => w.Title);
680+
context.Load(web, w => w.Title, w => w.Description);
680681

681682
context.ExecuteQuery();
682683

683-
ListCreationInformation creationInfo = new ListCreationInformation();
684+
ListCreationInformation creationInfo = new ListCreationInformation();
685+
creationInfo.TemplateType = (int)ListTemplateType.Announcements;
684686
creationInfo.Description = web.Description;
685687
creationInfo.Title = web.Title;
686688
SP.List newList = web.Lists.Add(creationInfo);
@@ -694,7 +696,7 @@ context.ExecuteQuery();
694696
The difference is the following three lines:
695697

696698
```csharp
697-
context.Load(web, w => w.Title);
699+
context.Load(web, w => w.Title, w => w.Description);
698700
context.ExecuteQuery();
699701
...
700702
context.ExecuteQuery();

0 commit comments

Comments
 (0)