Access to HttpContext in ICacheHash #178
-
I'm migrating my Episerver (now Optimizely) ImageProcessor package (+222k downloads!) to their new .NET 5 version by using ImageSharp.Web. I'm doing this because I want to store each cached item in the same folder/container as the source file. Abusing the hash to transfer the container name to my IImageCache derived class... Any suggestion to achieve this with a more standard approach appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Can you not just inject the |
Beta Was this translation helpful? Give feedback.
-
Gotta say this seems like a really odd setup. What about multiple sources? |
Beta Was this translation helpful? Give feedback.
Can you not just inject the
IHttpContextAccessor
into your custom implementation?https://docs.microsoft.com/en-us/aspnet/core/fundamentals/http-context?view=aspnetcore-5.0#use-httpcontext-from-custom-components