SPquery Results in an IEnumerable

On one of my SharePoint projects where I had to build a timer job I wanted to write it as DRY as possible. What I did was to remove the three SPList queries (records were chained in a parent, child, child hierarchy) and put in place a controller and a data access class that returned an IEnumerable of SPListItems.

By sending the SPList name and CAML query I was able to remove a couple blocks of code and make the SPQuery a lot more generic.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.