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();
David SmithPosted Jul 27, 2018, 9:40 PM
Jefferson S. MottaPosted Jul 27, 2018, 9:37 PM
David SmithPosted Jul 27, 2018, 8:21 PM
Jefferson S. MottaPosted Jul 27, 2018, 9:40 AM
David SmithPosted Jul 27, 2018, 12:02 AM
Jefferson S. MottaPosted Jul 26, 2018, 7:28 PM
public void UpdateAccessTime() => AccessTime = DateTime.Now.Ticks;
// so you can convert AccessTime to DateTime
private DateTime TimeStamp => Convert.ToDateTime(AccessTime);