How can one create a document library from custom library template with Folder structure inside using CSOM?
I have created my template and when creating an instance of that manually folders are created. The challenge is when doing it programatically the folder structure doesn't show.
This is what I have thus far:
var listTemplate = clientContext.Site.GetCustomListTemplates(clientContext.Site.RootWeb).GetByName("Test");
clientContext.Load(listTemplate, lt=> lt.Name, lt => lt.FeatureId, lt => lt.ListTemplateTypeKind);
clientContext.ExecuteQuery();
listCreationInfo.TemplateFeatureId = listTemplate.FeatureId;
listCreationInfo.TemplateType = listTemplate.ListTemplateTypeKind;
List newList = oWeb.Lists.Add(listCreationInfo);
newList.EnableFolderCreation = true;
newList.ContentTypesEnabled = true;
clientContext.ExecuteQuery();
Any help would be appreciated.