Skip to content

Commit c01f868

Browse files
authored
Merge pull request #15 from Leefrost/warnings-fix
Fixed warnings with null value
2 parents 51aba17 + 93cb3ea commit c01f868

File tree

5 files changed

+20
-3
lines changed

5 files changed

+20
-3
lines changed

samples/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## HttpClient.Cache - Samples
2+
3+
Simple console app with in-memory example for cache.
4+
5+
`ConsoleApp` works only with caching data from external source.

src/HttpClient.Cache/InMemory/CacheEntry.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ internal CacheEntry(
3434
}
3535

3636
public object Key { get; }
37-
public object Value { get; set; }
37+
public object Value { get; set; } = null!;
3838

3939
public CacheEntryPriority Priority { get; set; } = CacheEntryPriority.Normal;
4040

@@ -222,7 +222,7 @@ internal void InvokeEvictionCallbacks()
222222
return;
223223
}
224224

225-
Task.Factory.StartNew(state => InvokeCallbacks((CacheEntry)state), this, CancellationToken.None,
225+
Task.Factory.StartNew(state => InvokeCallbacks((CacheEntry)state!), this, CancellationToken.None,
226226
TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
227227
}
228228

src/HttpClient.Cache/InMemory/MemoryCache.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ private void StartScanForExpiredItems()
233233

234234
_lastExpirationScan = currentTime;
235235

236-
Task.Factory.StartNew(state => ScanForExpiredItems((MemoryCache)state), this, CancellationToken.None,
236+
Task.Factory.StartNew(state => ScanForExpiredItems((MemoryCache)state!), this, CancellationToken.None,
237237
TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
238238
}
239239

src/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## HttpClient.Cache - Code
2+
3+
The Source code. This folder and project will be packaged
4+
5+

tests/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## HttpClient.Cache - Tests
2+
3+
Unit tests for cache package.
4+
5+
Test framework - Xunit.
6+
7+

0 commit comments

Comments
 (0)