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 SpxusGetIContentByKey <Key> GetIContentById <Key, T>( Func <Key, IContent> serviceFunction, IDictionary <Key, T> cache) where T : CacheBase, new() { return((id) => { return GetFunc.GetContentByKey <Key, IContent, T>(id, false, serviceFunction, cache); }); }
public static SpxusGetIContentsByString GetIContentsByContentTypeName <T>( Func <string, Func <IEnumerable <IContent> > > serviceFunction, Func <string, Func <IDictionary <int, T>, IEnumerable <T> > > cacheFunction, IDictionary <int, T> cache, Func <string, bool> checkQueryName, int expireMins = 30 ) where T : CacheBase, new() { return((name, where, alive, queryName) => { var queryNameCheck = G.Text(queryName); if (queryNameCheck == "") { queryNameCheck = $"Icontent Type name {name}"; } return GetFunc.GetChildContentsByQuery(serviceFunction(name), cacheFunction(name), b => b.Id, cache, where, alive, expireMins, checkQueryName(queryNameCheck)); }); }
public static SpxusGetIContentsByKey <int> GetChildIContentByRootId <T>( Func <int, IEnumerable <IContent> > serviceFunction, Func <int, IDictionary <int, T>, IEnumerable <T> > cacheFunction, IDictionary <int, T> cache, Func <string, bool> checkQueryName, int expireMins = 30 ) where T : CacheBase, new() { return((rootId, where, alive, queryName) => { var queryNameCheck = G.Text(queryName); if (queryNameCheck == "") { queryNameCheck = $"icontent children {G.Text(rootId)}"; } return GetFunc.GetChildContentsByKey <int, IContent, T>( serviceFunction, cacheFunction, b => b.Id, cache, rootId, alive, expireMins, where, checkQueryName(queryNameCheck)); }); }
public static SDHCGetIPublishedContentByString GetIPublishContentsByContentTypeName <Key, T>( Func <string, Func <IEnumerable <IPublishedContent> > > serviceFunction, Func <string, Func <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((name, where, alive, queryName) => { var queryNameCheck = G.Text(queryName); if (queryNameCheck == "") { queryNameCheck = $"documentType {name}"; } return GetFunc.GetChildContentsByQuery <Key, IPublishedContent, T>( serviceFunction(name), cacheFunction(name), getKeyFunction, cache, where, alive, expireMins, checkQueryName(queryNameCheck)); }); }
public static SDHCGetIPublishedContentsByKey <Key> GetChildIPublishContentByRootId <Key, T>( Func <Key, IEnumerable <IPublishedContent> > serviceFunction, Func <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((rootId, where, alive, queryName) => { var queryNameCheck = G.Text(queryName); if (queryNameCheck == "") { queryNameCheck = $"children {G.Text(rootId)}"; } return GetFunc.GetChildContentsByKey <Key, IPublishedContent, T>( serviceFunction, cacheFunction, getKeyFunction, cache, rootId, alive, expireMins, where, checkQueryName(queryNameCheck)); }); }
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); }); }