'c# CSOM Create a list with a view based on retrieved data from another list

I get a list from sharePoint using CSOM and I have a data model: Microsoft.SharePoint.Client.List. How to create an identical list from it? It's all about its appearance and columns. Choosing a list from ready-made sharepoint templates

Obtained list with columns

using Microsoft.SharePoint.Client;
using System.Linq;
 
using (ClientContext context = new ClientContext("http://MyServer/sites/MySiteCollection"))
{
    ListCollection collList = context.Web.Lists;
            context.Load(collList, lists => lists.Include(
                    list => list.Title,
                    list => list.Id,
                    list => list.BaseTemplate,
                    list => list.SchemaXml,
                    list => list.Description,
                    list => list.LastItemModifiedDate,
                    list => list.BaseType,
                    list => list.TemplateTypeId,
                    list => list.Views,
                    list=> list.Fields,
                    list=> list.TemplateFeatureId,
                    list => list.Hidden,
                    list => list.ContentTypesEnabled
                    ));

            context.ExecuteQuery();
}

I found that this is a view only when I download all the views on the page, it is silent with the given name. I tried to create a view based on the 'Microsoft.SharePoint.Client.List' field but did not get the expected result. How to correctly complete the 'Microsoft.SharePoint.Client.ListCreationInformation' model to get a list from the web.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source