using System; namespace StardewModdingAPI.Web.Framework.Caching { /// A cache entry. /// The cached value type. internal class Cached { /********* ** Accessors *********/ /// The cached data. public T Data { get; } /// When the data was last updated. public DateTimeOffset LastUpdated { get; } /// When the data was last requested through the mod API. public DateTimeOffset LastRequested { get; internal set; } /********* ** Public methods *********/ /// Construct an instance. /// The cached data. public Cached(T data) { this.Data = data; this.LastUpdated = DateTimeOffset.UtcNow; this.LastRequested = DateTimeOffset.UtcNow; } } }