none
Sharepoint List Collection matching certain criteria RRS feed

  • Question

  • Hi,

    I am trying to get list collection ,

    like list title which is in the array

    ex String[] array={"t1","t2"}

    get listcollection whose list.title in array in a single load function.

    context.load(context.web.lists,lists=>lists.Include(l=>l.Title).Where(l.title in array)

    Thanks & Regards,

    Sai Monesh C S


    Sai Monesh.cs

    Wednesday, December 4, 2019 5:06 AM

All replies

  • Hi,

    Sample code for your reference.

    List<String> array = new List<String> { "List1", "List2" };             
                    var _Lists = context.Web.Lists;
                    context.Load(_Lists,lists=>lists.Include(l=>l.Title));
                    context.ExecuteQuery();
                    var filterResult= _Lists.Where(l => array.Contains(l.Title)).ToList();

    Best Regards,

    Lee


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Wednesday, December 4, 2019 8:12 AM