CacheData object for use with CacheDataService

using System; using System.Linq; namespace SiteStack.Sitefinity.CacheService.Data.Abstract { /// <summary> /// CacheableData interface for use with ICacheableDataService. CacheableDataService requires objects being cached to implement ICacheableData /// </summary> public interface ICacheData<T> { /// <summary> /// Unique identifier for the cacheable data item /// </summary> Guid Id { get; } /// <summary> /// The Sitefinity content type being processed /// </summary> Type GetContentType<T>(); /// <summary> /// Sets necessary members from Sitefinity content item /// </summary> /// <param name="T">Sitefinity content type to be parsed</param> void MapItem(T sitefinityContent); /// <summary> /// Returns a unique string for looking up the item /// </summary> /// <returns></returns> string ItemKey(); /// <summary> /// Gets IQueryable that returns what's deemed as the base data set of Sitefinity items to be cached /// </summary> /// <returns>IQueryable</returns> IQueryable<T> GetBaseSitefinityDataSetQuery<T>(); } }
My Sitefinity CacheData interface. Implement with a concrete class (passing in a Sitefinity data type) to utilize that class with the CacheDataService (different snippet)

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.