I am trying to create custom list using a custom list template in csom. My lst get created but it doesn't contain the schema of the list template. It looks like a generic list.
Please let me know how can I create custom list using my custom template in CSOM?
ListCreationInformation lci;
List listInstance;
lci = new ListCreationInformation();
lci.Title = listName;
lci.Description = listDescription;
ListTemplate lt = collection.First(z => z.Name == listTemplate);
lci.TemplateFeatureId = lt.FeatureId;
lci.TemplateType = lt.ListTemplateTypeKind;
listInstance = web.Lists.Add(lci);
context.Load(web.Lists);
context.ExecuteQuery();