예제 #1
0
        public async Task <string> CreateVersion(string slotId, ValueSupplier supplier, string description = null)
        {
            var request = new Version
            {
                SlotType = new VersionSlotType
                {
                    Description = description,
                    Definition  = new VersionDefinition(supplier)
                }
            };
            var response = await Client.CreateVersion(slotId, request);

            return(await response.StringOrError(HttpStatusCode.Accepted));
        }
예제 #2
0
 public TValue Refresh()
 {
     _value = ValueSupplier.Invoke();
     return(Peek());
 }
예제 #3
0
 /// <summary>
 /// Forces an invocation of <see cref="ValueSupplier"/> and stores the result in <see cref="_storedValue"/>, regardless of the current <see cref="Freshness"/>.
 /// </summary>
 /// <remarks>
 /// This method should rarely be called externally, as it bypasses the <see cref="StalenessPredicate"/> and <b>always</b> invokes the <see cref="ValueSupplier"/>.
 /// Most of the time, you should call <see cref="Value"/> instead.
 /// </remarks>
 /// <returns>the result of <see cref="ValueSupplier"/></returns>
 public TValue Refresh()
 {
     _storedValue           = ValueSupplier.Invoke();
     PreviousStalenessBasis = StalenessBasisSupplier.Invoke();
     return(_storedValue);
 }