Exemplo n.º 1
0
        /// <summary>
        /// Determines the <see cref="DateTime"/> (UTC) the <paramref name="key"/> expires.
        /// </summary>
        /// <param name="cache">The cache to use.</param>
        /// <param name="key">The key to check.</param>
        /// <param name="scheduler"><see cref="IScheduler"/> to perform the check on.</param>
        /// <returns>
        /// An observable stream that returns the <see cref="DateTime"/> (UTC) the <paramref name="key"/> expires.
        /// </returns>
        public static IObservable <DateTime> ExpiresAt <TKey, TValue>(
            this IObservableCache <TKey, TValue> cache,
            TKey key, IScheduler scheduler = null)
        {
            if (cache == null)
            {
                throw new ArgumentNullException(nameof(cache));
            }
            if (key == null)
            {
                throw new ArgumentNullException(nameof(key));
            }

            return(cache.ExpiresAt(Observable.Return(key), scheduler));
        }