Create sharepoint list
21/01/2014 11:57
static void Main(string[] args)
{
string listTitle = "My List";
ClientContext context = new ClientContext("https://sitecollectionurl");
Web web = context.Web;
IEnumerable<List> result = context.LoadQuery(web.Lists.Include(myList => myList.Title));
context.ExecuteQuery();
List list = result.FirstOrDefault(myList => myList.Title == listTitle);
if (list == null)
{
ListCreationInformation creationInfo = new ListCreationInformation();
creationInfo.Title = listTitle;
creationInfo.Url = "InfoOdgeneralnehoRiaditela";
creationInfo.TemplateType = (int)ListTemplateType.Announcements;
list = web.Lists.Add(creationInfo);
list.Description = "My List Description";
list.Update();
context.ExecuteQuery();
}
Console.ReadLine();
}