You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe the problem.
I've been trying to implement a system based on eTag to return a 304 in case the existing resource has not changed in the Database.
I have a HybridCache instance working alongside this ETag in the API layer. When returning a tuple ( obj, string ) from the cache, they are returned as null, even if values are attributed in the service call. Provided sample code:
var tags = new List<string> { "test" };
var entryOptions = new HybridCacheEntryOptions
{
Expiration = TimeSpan.FromMinutes(1),
LocalCacheExpiration = TimeSpan.FromMinutes(1)
};
var clientETag = httpContext.Request.Headers["If-None-Match"].FirstOrDefault();
var (result, eTag) = await _cache.GetOrCreateAsync($"identifier", async get =>
{
var (result, eTag) = await _companyService.GetPaginatedBillsAasync(companyId, filter, clientETag); // values retrieved from service
return (result, eTag); // values are attributed.
}, entryOptions, tags); // values are still shown in breakpoints
// After reaching this point, result and eTag are now null.
if (result == null) // Here result is always null.
{
return Results.StatusCode(304);
}
Describe the solution you'd like
I expect the tuple to retain it's value after the Func has finished it's execution.
Additional context
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
I've been trying to implement a system based on eTag to return a 304 in case the existing resource has not changed in the Database.
I have a HybridCache instance working alongside this ETag in the API layer. When returning a tuple ( obj, string ) from the cache, they are returned as null, even if values are attributed in the service call. Provided sample code:
Describe the solution you'd like
I expect the tuple to retain it's value after the Func has finished it's execution.
Additional context
The text was updated successfully, but these errors were encountered: