I have created a console application which creates a site collection and updates a links list in an existing sharepoint site which acts as a site register.
The code for adding a new entry to the list works and adds the url of the new site to my site register as intended. Here is the code I use to do this:
Console.WriteLine("Updating Workplace Site Register");
string siteUrl = "http://contoso.com";
ClientContext clientContext = new ClientContext(siteUrl);
SP.List oList = clientContext.Web.Lists.GetByTitle("Site Register");
ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation();
ListItem oListItem = oList.AddItem(itemCreateInfo);
oListItem["URL"] = mainurl;
oListItem.Update();
clientContext.ExecuteQuery();
Currently this causes the raw url of the new site to appear in the site register as a link. There is a Description
field attached to each URL in a links list which sets the display value of the new link.
How can I alter my code so that it also updates this field and my new link displays in a more user friendly fashion?