mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Update SQLiteCache.cs
This commit is contained in:
parent
5d649adbfa
commit
339fcbe3a4
|
|
@ -195,29 +195,6 @@ namespace MapControl.Caching
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void CheckArgument(string key)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(key))
|
|
||||||
{
|
|
||||||
throw new ArgumentException($"The {nameof(key)} argument must not be null or empty.", nameof(key));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void CheckArguments(string key, byte[] value, DistributedCacheEntryOptions options)
|
|
||||||
{
|
|
||||||
CheckArgument(key);
|
|
||||||
|
|
||||||
if (value == null)
|
|
||||||
{
|
|
||||||
throw new ArgumentNullException($"The {nameof(value)} argument must not be null.", nameof(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options == null)
|
|
||||||
{
|
|
||||||
throw new ArgumentNullException($"The {nameof(options)} argument must not be null.", nameof(options));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private SQLiteCommand GetItemCommand(string key)
|
private SQLiteCommand GetItemCommand(string key)
|
||||||
{
|
{
|
||||||
var command = new SQLiteCommand("select buffer from items where key = @key and expiration > @now", connection);
|
var command = new SQLiteCommand("select buffer from items where key = @key and expiration > @now", connection);
|
||||||
|
|
@ -251,5 +228,28 @@ namespace MapControl.Caching
|
||||||
command.Parameters.AddWithValue("@now", DateTimeOffset.UtcNow.Ticks);
|
command.Parameters.AddWithValue("@now", DateTimeOffset.UtcNow.Ticks);
|
||||||
return command;
|
return command;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void CheckArgument(string key)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(key))
|
||||||
|
{
|
||||||
|
throw new ArgumentException($"The {nameof(key)} argument must not be null or empty.", nameof(key));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void CheckArguments(string key, byte[] value, DistributedCacheEntryOptions options)
|
||||||
|
{
|
||||||
|
CheckArgument(key);
|
||||||
|
|
||||||
|
if (value == null)
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException($"The {nameof(value)} argument must not be null.", nameof(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options == null)
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException($"The {nameof(options)} argument must not be null.", nameof(options));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue