I noticed that you used a timestamp to keep track of your access time. If we ever multithread this cache or if we run on an operating system that does not have a high granularity timestamp this will cause the cache to run incorrectly. Can you refactor your logic so that this will work correctly under any circumstance.
I am using this below. How to refactor this to make sure this will work under any circumstance
public void UpdateAccessTime() => AccessTime = Stopwatch.GetTimestamp();

Jefferson S. MottaRank #207 · 11.7K reputationPosted Jul 26, 2018, 3:28 PM EDT
public void UpdateAccessTime() => AccessTime = DateTime.Now.Ticks;
// so you can convert AccessTime to DateTime
private DateTime TimeStamp => Convert.ToDateTime(AccessTime);
David SmithRank #999 · 2K reputationPosted Jul 26, 2018, 8:02 PM EDT
Jefferson S. MottaRank #207 · 11.7K reputationPosted Jul 27, 2018, 5:40 AM EDT
David SmithRank #999 · 2K reputationPosted Jul 27, 2018, 4:21 PM EDT
Jefferson S. MottaRank #207 · 11.7K reputationPosted Jul 27, 2018, 5:37 PM EDT
David SmithRank #999 · 2K reputationPosted Jul 27, 2018, 5:40 PM EDT