Skip to content

Commit 2011101

Browse files
committed
Missing example in example
1 parent 3afb87a commit 2011101

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ example
6565

6666
@code {
6767

68-
public async Task<GetMultipleDayItemResponse?> GetDayItemsAsync(DateRange dateRange, Guid userId, CancellationToken clt)
68+
public async Task<YourObjectResponse?> GetDayItemsAsync(DateRange dateRange, Guid userId, CancellationToken clt)
6969
{
7070
var cacheKey = "CACHE_KEY_HERE"
7171
var response = await storageService.CachedRequestAsync(cacheKey),
@@ -94,6 +94,17 @@ You can give optional settings to the CachedRequest object.
9494

9595
On, for example, MainLayout.razor.cs, you can set the Postfix to be used for all requests. This is useful if you have multiple users using the same app from the same browser.
9696

97+
`ExpireStorageService.Postfix = userId.ToString();`
98+
9799
### ICacheableResponse
98100

99-
If a response object implements ICacheableResponse, the FromCache property will be set to true if the result was retrieved from cache.
101+
If a response object implements ICacheableResponse, the FromCache property will be set to true if the result was retrieved from cache.
102+
103+
```c#
104+
public class YourObjectResponse : ICacheableResponse
105+
{
106+
...
107+
public bool FromCache { get; set; }
108+
...
109+
}
110+
```

0 commit comments

Comments
 (0)