Browse by Tags

All Tags » .net code » Linq (RSS)
Sorry, but there are no more tags available to filter with.

Caching the results from LinqDataSource

I wanted to be able to cache the results of a query from the LinqDataSource that was used in multiple places on the page. I whipped up this little class to do the work of caching for me. The class, LinqCacheDataSource, handles the Selecting and Selected events. The Selected handler inserts the result of the query into cache. The Selecting handler gets the result from the cache. If it doesn't find the result, the query runs as normal. The caching will only work for selecting data. It works great for dropdowns and other fairly static data....
Posted by pwelter34 | 5 comment(s)
Filed under: ,

Easier way to page Linq queries.

The following query extension will make paging a query more natural then skip and take. Simply append Paginate(page, pageSize) to your query. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace System.Linq ...
Posted by pwelter34 | with no comments
Filed under: ,
More Posts