18 lines
338 B
C#
18 lines
338 B
C#
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);
|
|
}
|
|
|
|
}
|
|
}
|