Soenneker.Validators.ExpiringKey 3.0.542

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Validators.ExpiringKey --version 3.0.542                
NuGet\Install-Package Soenneker.Validators.ExpiringKey -Version 3.0.542                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Validators.ExpiringKey" Version="3.0.542" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Soenneker.Validators.ExpiringKey --version 3.0.542                
#r "nuget: Soenneker.Validators.ExpiringKey, 3.0.542"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Soenneker.Validators.ExpiringKey as a Cake Addin
#addin nuget:?package=Soenneker.Validators.ExpiringKey&version=3.0.542

// Install Soenneker.Validators.ExpiringKey as a Cake Tool
#tool nuget:?package=Soenneker.Validators.ExpiringKey&version=3.0.542                

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image Soenneker.Validators.ExpiringKey

A validation module that checks for keys, stores them, expires them after an amount of time

Ideal for caching, session management, and more.

🚀 Features

  • Validate Key: Check if a key exists.
  • Add Key: Add a key with an expiration time.
  • Validate and Add: Validate if a key exists and add it if not.
  • Remove Key: Remove a key.

Installation

dotnet add package Soenneker.Validators.ExpiringKey

💻 Usage

IExpiringKeyValidator can be registered within DI, and injected:

public static async Task Main(string[] args)
{
    ...
    builder.Services.AddExpiringKeyValidatorAsSingleton();
}

or it can be initialized manually: new ExpiringKeyValidator().

Validate Key

Check if a key is present.

bool Validate(string key)

Add Key

Add a key with an expiration time.

void Add(string key, int expirationTimeMilliseconds)

Validate and Add Key

Validate a key and add it if it doesn't exist.

bool ValidateAndAdd(string key, int expirationTimeMilliseconds) // true if doesn't exist, false if it does

Remove Key

Remove a key.

void Remove(string key)

Example

var validator = new ExpiringKeyValidator();
validator.Add("key1", 5000); // 5 seconds

var invalid = validator.Validate("key1"); // false, key exists

await Task.Delay(7000); // wait 7 seconds

var validAfterTime = validator.Validate("key1"); // true, key does not exist
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.0.558 70 11/21/2024
3.0.557 68 11/21/2024
3.0.556 65 11/21/2024
3.0.555 70 11/21/2024
3.0.554 65 11/21/2024
3.0.553 70 11/20/2024
3.0.552 73 11/20/2024
3.0.551 69 11/20/2024
3.0.550 74 11/20/2024
3.0.549 70 11/20/2024
3.0.548 70 11/20/2024
3.0.547 67 11/20/2024
3.0.546 67 11/20/2024
3.0.545 70 11/20/2024
3.0.544 69 11/20/2024
3.0.543 72 11/19/2024
3.0.542 65 11/19/2024
3.0.541 63 11/19/2024
3.0.540 64 11/19/2024
3.0.539 69 11/19/2024
3.0.538 63 11/19/2024
3.0.537 64 11/19/2024
3.0.536 70 11/15/2024
3.0.535 73 11/15/2024
3.0.534 66 11/14/2024
3.0.533 65 11/14/2024
3.0.532 65 11/14/2024
3.0.531 67 11/14/2024
3.0.530 62 11/14/2024
3.0.529 69 11/14/2024
3.0.528 65 11/14/2024
3.0.527 67 11/14/2024
3.0.526 64 11/14/2024
3.0.525 56 11/14/2024
3.0.524 67 11/14/2024
3.0.523 64 11/14/2024
3.0.522 69 11/14/2024
3.0.521 67 11/14/2024
3.0.520 71 11/14/2024
3.0.519 70 11/14/2024
3.0.518 65 11/14/2024
3.0.517 65 11/14/2024
3.0.516 67 11/14/2024
3.0.515 62 11/14/2024
3.0.514 64 11/14/2024
3.0.513 71 11/14/2024
3.0.512 75 11/14/2024
2.1.511 67 11/13/2024
2.1.510 68 11/13/2024
2.1.509 65 11/13/2024
2.1.508 65 11/13/2024
2.1.507 63 11/13/2024
2.1.506 62 11/13/2024
2.1.505 70 11/13/2024
2.1.504 70 11/13/2024
2.1.503 66 11/13/2024
2.1.502 64 11/13/2024
2.1.501 71 11/12/2024
2.1.500 65 11/12/2024
2.1.499 64 11/12/2024
2.1.498 77 11/9/2024
2.1.497 85 11/9/2024
2.1.496 76 11/9/2024
2.1.495 77 11/9/2024
2.1.494 75 11/9/2024
2.1.493 78 11/9/2024
2.1.492 75 11/9/2024
2.1.491 77 11/9/2024
2.1.490 71 11/9/2024
2.1.489 79 11/9/2024
2.1.488 77 11/8/2024
2.1.487 71 11/8/2024
2.1.486 71 11/8/2024
2.1.485 69 11/8/2024
2.1.484 76 11/8/2024
2.1.483 76 11/8/2024
2.1.482 75 11/8/2024
2.1.481 75 11/8/2024
2.1.480 80 11/8/2024
2.1.479 70 11/6/2024
2.1.478 69 11/6/2024
2.1.477 73 11/1/2024
2.1.476 75 11/1/2024
2.1.475 72 11/1/2024
2.1.474 67 11/1/2024
2.1.473 80 10/29/2024
2.1.472 69 10/29/2024
2.1.471 83 10/29/2024
2.1.470 67 10/29/2024
2.1.469 77 10/29/2024
2.1.468 75 10/29/2024
2.1.467 78 10/29/2024
2.1.466 69 10/29/2024
2.1.465 70 10/29/2024
2.1.464 72 10/29/2024
2.1.463 68 10/29/2024
2.1.462 67 10/29/2024
2.1.461 74 10/28/2024
2.1.460 73 10/28/2024
2.1.459 78 10/26/2024
2.1.458 79 10/26/2024
2.1.457 78 10/26/2024
2.1.456 71 10/26/2024
2.1.455 76 10/26/2024
2.1.454 80 10/22/2024
2.1.453 70 10/22/2024
2.1.452 74 10/22/2024
2.1.451 73 10/22/2024
2.1.450 75 10/22/2024
2.1.449 78 10/22/2024
2.1.448 71 10/22/2024
2.1.447 70 10/22/2024
2.1.446 71 10/22/2024
2.1.445 64 10/22/2024
2.1.444 68 10/22/2024
2.1.443 108 10/18/2024
2.1.442 104 10/18/2024
2.1.441 78 10/17/2024
2.1.440 85 10/17/2024
2.1.439 80 10/17/2024
2.1.438 79 10/17/2024
2.1.437 78 10/15/2024
2.1.436 75 10/15/2024
2.1.435 70 10/15/2024
2.1.434 76 10/15/2024
2.1.433 81 10/14/2024
2.1.432 80 10/12/2024
2.1.431 83 10/12/2024
2.1.430 77 10/12/2024
2.1.429 79 10/12/2024
2.1.428 76 10/12/2024
2.1.427 84 10/11/2024
2.1.426 76 10/11/2024
2.1.425 79 10/11/2024
2.1.424 83 10/11/2024
2.1.423 85 10/11/2024
2.1.422 80 10/9/2024
2.1.421 77 10/9/2024
2.1.420 77 10/9/2024
2.1.419 77 10/9/2024
2.1.418 78 10/9/2024
2.1.417 73 10/9/2024
2.1.416 81 10/9/2024
2.1.415 75 10/9/2024
2.1.414 76 10/9/2024
2.1.413 68 10/9/2024
2.1.412 80 10/9/2024
2.1.411 76 10/9/2024
2.1.410 77 10/8/2024
2.1.409 78 10/8/2024
2.1.408 77 10/8/2024
2.1.407 77 10/8/2024
2.1.406 74 10/8/2024
2.1.405 89 10/8/2024
2.1.404 79 10/8/2024
2.1.403 88 10/8/2024
2.1.402 75 10/3/2024
2.1.401 74 10/3/2024
2.1.400 68 10/3/2024
2.1.399 76 10/3/2024
2.1.398 77 10/3/2024
2.1.397 73 10/3/2024
2.1.396 119 10/3/2024
2.1.395 73 10/3/2024
2.1.394 80 10/3/2024
2.1.393 72 10/3/2024
2.1.392 78 10/2/2024
2.1.391 73 10/2/2024
2.1.390 74 10/2/2024
2.1.389 71 10/2/2024
2.1.388 81 10/2/2024
2.1.387 73 10/2/2024
2.1.386 66 10/2/2024
2.1.385 81 10/2/2024
2.1.384 78 10/2/2024
2.1.383 81 10/1/2024
2.1.382 70 10/1/2024
2.1.381 73 10/1/2024
2.1.380 74 10/1/2024
2.1.379 74 10/1/2024
2.1.378 77 10/1/2024
2.1.377 74 10/1/2024
2.1.376 78 10/1/2024
2.1.375 79 10/1/2024
2.1.374 78 9/29/2024
2.1.373 74 9/29/2024
2.1.372 80 9/29/2024
2.1.371 75 9/29/2024
2.1.370 83 9/29/2024
2.1.369 83 9/29/2024
2.1.368 87 9/29/2024
2.1.367 79 9/29/2024
2.1.366 75 9/27/2024
2.1.365 81 9/27/2024
2.1.364 77 9/27/2024
2.1.363 79 9/27/2024
2.1.362 76 9/27/2024
2.1.361 76 9/27/2024
2.1.360 77 9/27/2024
2.1.359 83 9/27/2024
2.1.358 85 9/27/2024
2.1.357 75 9/27/2024
2.1.356 76 9/27/2024
2.1.355 73 9/27/2024
2.1.354 83 9/27/2024
2.1.353 76 9/27/2024
2.1.352 74 9/27/2024
2.1.351 82 9/27/2024
2.1.350 87 9/27/2024
2.1.349 75 9/27/2024
2.1.348 77 9/26/2024
2.1.347 81 9/26/2024
2.1.346 86 9/26/2024
2.1.345 78 9/26/2024
2.1.344 86 9/26/2024
2.1.343 81 9/26/2024
2.1.342 83 9/26/2024
2.1.341 81 9/26/2024
2.1.340 79 9/26/2024
2.1.339 77 9/26/2024
2.1.338 78 9/26/2024
2.1.337 79 9/26/2024
2.1.336 77 9/26/2024
2.1.335 75 9/26/2024
2.1.334 82 9/26/2024
2.1.333 88 9/24/2024
2.1.332 84 9/23/2024
2.1.331 74 9/23/2024
2.1.330 85 9/23/2024
2.1.329 84 9/23/2024
2.1.328 83 9/23/2024
2.1.327 75 9/23/2024
2.1.326 93 9/23/2024
2.1.325 73 9/23/2024
2.1.324 82 9/23/2024
2.1.323 79 9/23/2024
2.1.322 84 9/23/2024
2.1.321 77 9/23/2024
2.1.320 72 9/23/2024
2.1.319 80 9/23/2024
2.1.318 90 9/23/2024
2.1.317 75 9/23/2024
2.1.316 75 9/23/2024
2.1.315 84 9/23/2024
2.1.314 71 9/23/2024
2.1.313 73 9/23/2024
2.1.312 77 9/19/2024
2.1.311 76 9/18/2024
2.1.310 80 9/18/2024
2.1.309 80 9/18/2024
2.1.308 89 9/18/2024
2.1.307 82 9/18/2024
2.1.306 89 9/18/2024
2.1.305 85 9/17/2024
2.1.304 91 9/17/2024
2.1.303 82 9/17/2024
2.1.302 80 9/17/2024
2.1.301 88 9/17/2024
2.1.300 88 9/17/2024
2.1.299 85 9/17/2024
2.1.297 78 9/17/2024
2.1.296 109 9/17/2024
2.1.295 95 9/17/2024
2.1.294 100 9/17/2024
2.1.293 102 9/17/2024
2.1.292 96 9/17/2024
2.1.291 98 9/17/2024
2.1.290 98 9/17/2024
2.1.289 101 9/16/2024
2.1.288 93 9/16/2024
2.1.287 98 9/16/2024
2.1.286 103 9/16/2024
2.1.285 100 9/16/2024
2.1.284 97 9/16/2024
2.1.283 100 9/16/2024
2.1.282 105 9/12/2024
2.1.281 102 9/12/2024
2.1.280 112 9/12/2024
2.1.279 96 9/12/2024
2.1.278 101 9/12/2024
2.1.277 107 9/12/2024
2.1.276 96 9/12/2024
2.1.275 95 9/11/2024
2.1.274 98 9/11/2024
2.1.273 97 9/11/2024
2.1.272 99 9/11/2024
2.1.271 94 9/11/2024
2.1.269 105 9/11/2024
2.1.268 93 9/11/2024
2.1.267 98 9/11/2024
2.1.266 108 9/11/2024
2.1.265 96 9/11/2024
2.1.264 98 9/11/2024
2.1.263 95 9/10/2024
2.1.262 97 9/10/2024
2.1.261 101 9/10/2024
2.1.260 98 9/10/2024
2.1.259 95 9/10/2024
2.1.258 93 9/10/2024
2.1.257 86 9/10/2024
2.1.256 88 9/10/2024
2.1.255 86 9/10/2024
2.1.254 93 9/10/2024
2.1.253 95 9/10/2024
2.1.252 91 9/10/2024
2.1.251 91 9/10/2024
2.1.249 95 9/10/2024
2.1.248 87 9/10/2024
2.1.247 88 9/9/2024
2.1.246 91 9/9/2024
2.1.244 91 9/9/2024
2.1.243 99 9/9/2024
2.1.242 90 9/9/2024
2.1.241 92 9/9/2024
2.1.239 95 9/9/2024
2.1.238 85 9/9/2024
2.1.237 97 9/9/2024
2.1.236 96 9/9/2024
2.1.235 98 9/7/2024
2.1.234 98 9/7/2024
2.1.233 97 9/7/2024
2.1.232 88 9/7/2024
2.1.231 92 9/7/2024
2.1.230 92 9/7/2024
2.1.229 100 9/7/2024
2.1.228 87 9/7/2024
2.1.227 112 9/6/2024
2.1.226 98 9/6/2024
2.1.225 102 9/6/2024
2.1.224 100 9/6/2024
2.1.223 89 9/6/2024
2.1.222 104 9/6/2024
2.1.221 93 9/6/2024
2.1.220 99 9/6/2024
2.1.219 105 9/5/2024
2.1.218 95 9/5/2024
2.1.217 90 9/5/2024
2.1.216 85 9/5/2024
2.1.215 99 9/5/2024
2.1.214 96 9/5/2024
2.1.213 98 9/5/2024
2.1.212 95 9/5/2024
2.1.211 101 9/5/2024
2.1.210 91 9/5/2024
2.1.209 102 9/5/2024
2.1.208 96 9/5/2024
2.1.207 94 9/5/2024
2.1.206 95 9/5/2024
2.1.205 94 9/5/2024
2.1.204 98 9/5/2024
2.1.203 93 9/4/2024
2.1.202 93 9/4/2024
2.1.201 98 9/4/2024
2.1.200 96 9/4/2024
2.1.199 107 9/4/2024
2.1.198 98 9/3/2024
2.1.197 95 9/3/2024
2.1.196 98 9/3/2024
2.1.195 95 9/3/2024
2.1.194 98 9/3/2024
2.1.193 92 9/3/2024
2.1.192 72 9/3/2024
2.1.191 86 9/3/2024
2.1.190 104 9/3/2024
2.1.189 98 9/3/2024
2.1.188 93 9/3/2024
2.1.187 92 9/3/2024
2.1.186 85 9/3/2024
2.1.185 93 8/30/2024
2.1.184 99 8/29/2024
2.1.183 88 8/29/2024
2.1.182 94 8/29/2024
2.1.181 92 8/29/2024
2.1.180 88 8/29/2024
2.1.179 91 8/29/2024
2.1.178 97 8/26/2024
2.1.177 102 8/26/2024
2.1.176 104 8/26/2024
2.1.175 95 8/26/2024
2.1.174 94 8/26/2024
2.1.173 97 8/26/2024
2.1.172 102 8/26/2024
2.1.171 121 8/21/2024
2.1.170 123 8/21/2024
2.1.169 120 8/21/2024
2.1.168 119 8/21/2024
2.1.167 117 8/21/2024
2.1.166 116 8/21/2024
2.1.165 115 8/21/2024
2.1.164 113 8/21/2024
2.1.163 122 8/20/2024
2.1.162 118 8/20/2024
2.1.161 114 8/20/2024
2.1.160 108 8/20/2024
2.1.159 110 8/20/2024
2.1.158 95 8/20/2024
2.1.157 108 8/20/2024
2.1.156 99 8/20/2024
2.1.155 112 8/20/2024
2.1.154 108 8/20/2024
2.1.153 108 8/20/2024
2.1.152 108 8/20/2024
2.1.151 105 8/20/2024
2.1.150 110 8/19/2024
2.1.149 98 8/19/2024
2.1.148 116 8/15/2024
2.1.147 112 8/15/2024
2.1.146 114 8/15/2024
2.1.145 113 8/15/2024
2.1.144 114 8/15/2024
2.1.143 105 8/15/2024
2.1.142 108 8/14/2024
2.1.141 112 8/14/2024
2.1.140 87 8/14/2024
2.1.139 97 8/14/2024
2.1.138 93 8/14/2024
2.1.137 112 8/13/2024
2.1.136 79 8/7/2024
2.1.135 78 8/7/2024
2.1.134 103 8/7/2024
2.1.133 96 8/7/2024
2.1.132 95 8/7/2024
2.1.131 93 8/7/2024
2.1.130 81 8/7/2024
2.1.129 93 8/6/2024
2.1.128 79 8/6/2024
2.1.127 69 8/6/2024
2.1.126 73 8/1/2024
2.1.125 64 8/1/2024
2.1.124 62 8/1/2024
2.1.123 73 8/1/2024
2.1.122 66 8/1/2024
2.1.121 82 8/1/2024
2.1.120 70 8/1/2024
2.1.117 67 7/25/2024
2.1.116 81 7/25/2024
2.1.115 76 7/25/2024
2.1.114 81 7/25/2024
2.1.113 84 7/25/2024
2.1.112 80 7/25/2024
2.1.111 85 7/25/2024
2.1.110 84 7/25/2024
2.1.109 84 7/25/2024
2.1.108 79 7/25/2024
2.1.107 76 7/25/2024
2.1.106 85 7/24/2024
2.1.105 82 7/24/2024
2.1.103 98 7/24/2024
2.1.102 83 7/20/2024
2.1.101 75 7/20/2024
2.1.100 88 7/20/2024
2.1.99 88 7/20/2024
2.1.98 87 7/20/2024
2.1.97 82 7/20/2024
2.1.96 85 7/14/2024
2.1.95 74 7/14/2024
2.1.94 76 7/14/2024
2.1.93 62 7/14/2024
2.1.92 78 7/14/2024
2.1.91 79 7/14/2024
2.1.90 81 7/14/2024
2.1.89 82 7/14/2024
2.1.88 79 7/14/2024
2.1.87 73 7/14/2024
2.1.86 83 7/11/2024
2.1.85 80 7/10/2024
2.1.84 81 7/10/2024
2.1.83 79 7/10/2024
2.1.82 86 7/10/2024
2.1.81 79 7/10/2024
2.1.80 70 7/10/2024
2.1.79 83 7/10/2024
2.1.76 62 7/10/2024
2.1.75 89 7/10/2024
2.1.74 78 7/10/2024
2.1.73 79 7/10/2024
2.1.72 71 7/10/2024
2.1.71 81 7/10/2024
2.1.70 74 7/10/2024
2.1.69 73 7/10/2024
2.1.66 70 7/10/2024
2.1.65 90 7/10/2024
2.1.64 89 7/9/2024
2.1.61 58 7/9/2024
2.1.60 81 7/9/2024
2.1.59 79 7/9/2024
2.1.58 90 7/9/2024
2.1.57 84 7/9/2024
2.1.56 102 7/9/2024
2.1.55 103 7/9/2024
2.1.54 92 7/9/2024
2.1.53 86 7/9/2024
2.1.52 85 7/9/2024
2.1.51 87 7/9/2024
2.1.50 83 7/9/2024
2.1.49 76 7/9/2024
2.1.48 94 7/9/2024
2.1.47 80 7/9/2024
2.1.46 105 7/9/2024
2.1.45 102 7/8/2024
2.1.44 74 7/8/2024
2.1.43 89 7/8/2024
2.1.42 102 7/8/2024
2.1.41 84 7/8/2024
2.1.40 94 7/8/2024
2.1.39 76 7/8/2024
2.1.38 77 7/8/2024
2.1.37 103 7/7/2024
2.1.36 83 7/7/2024
2.1.35 96 7/7/2024
2.1.34 78 7/7/2024
2.1.33 105 7/3/2024
2.1.32 89 7/3/2024
2.1.31 108 7/3/2024
2.1.30 96 7/3/2024
2.1.29 95 7/3/2024
2.1.28 93 7/3/2024
2.1.27 93 7/3/2024
2.1.26 85 7/3/2024
2.1.25 88 7/3/2024
2.1.24 107 6/27/2024
2.1.23 110 6/27/2024
2.1.22 108 6/27/2024
2.1.21 106 6/27/2024
2.1.20 94 6/22/2024
2.1.19 100 6/22/2024
2.1.18 106 6/22/2024
2.1.17 102 6/22/2024
2.1.16 99 6/22/2024
2.1.15 103 6/16/2024
2.1.14 94 6/16/2024
2.1.13 140 6/15/2024
2.1.12 98 6/15/2024
2.1.11 82 6/15/2024
2.1.10 93 6/15/2024
2.1.9 109 6/15/2024
2.1.8 81 6/15/2024
2.1.7 93 6/15/2024
2.1.6 97 6/15/2024
2.1.5 80 6/15/2024
2.1.4 96 6/12/2024
2.1.3 85 6/12/2024