Quantcast
Channel: SharePoint 2010 - General Discussions and Questions forum
Viewing all articles
Browse latest Browse all 17574

Need help with understand use of .Include and associated code

$
0
0

It was suggested that I post my problem here, since it involves Sharepoint.

I'm struggling with understanding the following code segment.  Can someone explain it to me?

            //***List Read Stuff***
            clientContext = new ClientContext("http://xxx.xxx.com/xx/xxx_xx/Cost_Models/CostModelsPOC/");
            try
            {
                List oList = clientContext.Web.Lists.GetByTitle("Info");
                // *****************************************
                // Query Contents of List 
                // *****************************************    
                CamlQuery camlQuery = new CamlQuery();
                InfocollListItem = oList.GetItems(camlQuery);
                // *****************************************
                // Get Title, ID, and Labor Rate
                // *****************************************
                clientContext.Load(InfocollListItem,
                    items => items
                            .Include(
                                item => item["Title"],
                            item => item["ows__x006c_bl1"],
                            item => item["ows__x006c_bl2"],
                            item => item["ows__x006c_bl3"],
                            item => item["ows__x006c_bl4"],
                            item => item["ows__x006c_bl5"],
                            item => item["ows__x006c_bl6"],
                            item => item["ows__x006c_bl7"],
                            item => item["ows__x006c_bl8"],
                            item => item["ows__x006c_bl9"],
                            item => item["ows__x006c_bl10"]
                                ));
                clientContext.ExecuteQueryAsync(ReadInfoList, FailOperation);
            }

This is only one example of this "structure" being used -- it is repeated with different variations elsewhere in the code.  I am relative naive when it comes to Sharepoint;  I've inherited this code since the original two developers left our company.

Thanks,

Bob


Viewing all articles
Browse latest Browse all 17574

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>