Changes HasValue in Cachable to constructor argument
This commit is contained in:
@@ -16,7 +16,7 @@ namespace Discord
|
||||
/// <summary>
|
||||
/// Is this entity cached?
|
||||
/// </summary>
|
||||
public bool HasValue => !EqualityComparer<TEntity>.Default.Equals(Value, default(TEntity));
|
||||
public bool HasValue { get; }
|
||||
/// <summary>
|
||||
/// The ID of this entity.
|
||||
/// </summary>
|
||||
@@ -30,10 +30,11 @@ namespace Discord
|
||||
public TEntity Value { get; }
|
||||
private Func<Task<TEntity>> DownloadFunc { get; }
|
||||
|
||||
internal Cacheable(TEntity value, TId id, Func<Task<TEntity>> downloadFunc)
|
||||
internal Cacheable(TEntity value, TId id, bool hasValue , Func<Task<TEntity>> downloadFunc)
|
||||
{
|
||||
Value = value;
|
||||
Id = id;
|
||||
HasValue = hasValue;
|
||||
DownloadFunc = downloadFunc;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user