Exemple #1
0
        /// <summary>
        /// Gets the list of entries for the specified <see cref="EntryCriteria"/>.
        /// </summary>
        /// <param name="criteria">The criteria used to search for the entries.</param>
        /// <param name="resultOrder">The ordering of the results.</param>
        /// <returns>The list of entries for the criteria, or null if the criteria has not been cached.</returns>
        public SearchResults <Entry> Get(EntryCriteria criteria, ListOrder resultOrder)
        {
            Assert.ArgumentNotNull(criteria, nameof(criteria));

            var key = new EntrySearchCacheKey(criteria, resultOrder);

            return((SearchResults <Entry>)_cache.GetValue(key));
        }
Exemple #2
0
        /// <summary>
        /// Sets the list of entries for the specified <see cref="EntryCriteria"/>.
        /// </summary>
        /// <param name="criteria">The criteria used to search for the entries.</param>
        /// <param name="resultOrder">The ordering of the results.</param>
        /// <param name="entries">The entries for the search criteria.</param>
        public void Set(EntryCriteria criteria, ListOrder resultOrder, SearchResults <Entry> entries)
        {
            Assert.ArgumentNotNull(criteria, nameof(criteria));
            Assert.ArgumentNotNull(entries, nameof(entries));

            var key = new EntrySearchCacheKey(criteria, resultOrder);

            _cache.Add(key, entries);
        }