School Commit Init
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
|
||||
namespace CacheModule{
|
||||
|
||||
public class CachedObject
|
||||
{
|
||||
public object? Value { get; set; }
|
||||
public DateTime Timestamp {get; set; }
|
||||
public int Duration { get; set; }
|
||||
|
||||
public bool IsExpired()
|
||||
{
|
||||
return DateTime.Now > Timestamp.AddSeconds(Duration);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user