diff --git a/samples/README.md b/samples/README.md new file mode 100644 index 0000000..b127045 --- /dev/null +++ b/samples/README.md @@ -0,0 +1,5 @@ +## HttpClient.Cache - Samples + +Simple console app with in-memory example for cache. + +`ConsoleApp` works only with caching data from external source. diff --git a/src/HttpClient.Cache/InMemory/CacheEntry.cs b/src/HttpClient.Cache/InMemory/CacheEntry.cs index 2678d45..36b1cb3 100644 --- a/src/HttpClient.Cache/InMemory/CacheEntry.cs +++ b/src/HttpClient.Cache/InMemory/CacheEntry.cs @@ -34,7 +34,7 @@ internal CacheEntry( } public object Key { get; } - public object Value { get; set; } + public object Value { get; set; } = null!; public CacheEntryPriority Priority { get; set; } = CacheEntryPriority.Normal; @@ -222,7 +222,7 @@ internal void InvokeEvictionCallbacks() return; } - Task.Factory.StartNew(state => InvokeCallbacks((CacheEntry)state), this, CancellationToken.None, + Task.Factory.StartNew(state => InvokeCallbacks((CacheEntry)state!), this, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); } diff --git a/src/HttpClient.Cache/InMemory/MemoryCache.cs b/src/HttpClient.Cache/InMemory/MemoryCache.cs index 137b9f0..aded4fc 100644 --- a/src/HttpClient.Cache/InMemory/MemoryCache.cs +++ b/src/HttpClient.Cache/InMemory/MemoryCache.cs @@ -233,7 +233,7 @@ private void StartScanForExpiredItems() _lastExpirationScan = currentTime; - Task.Factory.StartNew(state => ScanForExpiredItems((MemoryCache)state), this, CancellationToken.None, + Task.Factory.StartNew(state => ScanForExpiredItems((MemoryCache)state!), this, CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default); } diff --git a/src/README.md b/src/README.md new file mode 100644 index 0000000..fd2b2ef --- /dev/null +++ b/src/README.md @@ -0,0 +1,5 @@ +## HttpClient.Cache - Code + +The Source code. This folder and project will be packaged + + diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 0000000..084fb77 --- /dev/null +++ b/tests/README.md @@ -0,0 +1,7 @@ +## HttpClient.Cache - Tests + +Unit tests for cache package. + +Test framework - Xunit. + +