Skip Ribbon Commands
Skip to main content

Blog

:

SPMCM.ME > Blog > Posts > Using LINQ to retrieve list of external lists in current web
October 09
Using LINQ to retrieve list of external lists in current web

This one is a short little post, I was looking for a way to use LINQ to query list of external lists created in current web, I didn’t want to enumerate through list collection and check the base template. See the code sample below.

Cheers,

</Ram>

var lists = (from el in web.Lists.OfType<SPList>()
            where el.BaseTemplate == SPListTemplateType.ExternalList
           select el);

 

Technorati Tags: ,
 

 Social Comments