public static SDHCGetIPublishedContentsByKeys <Key> GetIPublishContentsByIds <Key, T>( Func <IEnumerable <Key>, IEnumerable <IPublishedContent> > serverFunction, Func <IEnumerable <Key>, IDictionary <Key, T>, IEnumerable <T> > cacheFunction, Func <IPublishedContent, Key> getKeyFunction, IDictionary <Key, T> cache, Func <string, bool> checkQueryName, int expireMins = 30 ) where T : CacheBase, new() { return((ids, where, alive, queryName) => { var queryNameCheck = G.Text(queryName); if (queryNameCheck == "") { queryNameCheck = String.Join(",", ids); } var result = GetFunc.GetContentByKeys <Key, IPublishedContent, T>( ids, alive, serverFunction, cacheFunction, cache, getKeyFunction, expireMins, checkQueryName(queryNameCheck)); if (where == null) { return result; } return result.Where(where); }); }
public static SpxusGetIContentsByKeys <int> GetIContentsByIds <T>( Func <IEnumerable <int>, IEnumerable <IContent> > serverFunction, Func <IEnumerable <int>, IDictionary <int, T>, IEnumerable <T> > cacheFunction, IDictionary <int, T> cache, Func <string, bool> checkQueryName, int expireMins = 30 ) where T : CacheBase, new() { return((ids, where, alive, queryName) => { var queryNameCheck = G.Text(queryName); if (queryNameCheck == "") { queryNameCheck = $"Ids content {String.Join(",", ids)}"; } var result = GetFunc.GetContentByKeys <int, IContent, T>(ids, alive, serverFunction, cacheFunction, cache, b => b.Id, expireMins, checkQueryName(queryNameCheck)); if (where == null) { return result; } return result.Where(where); }); }