I want create middleware for my caching system and cache HttpContext data. my Challenge is handle get data from HttpRequest and send data to HttpResponse and combin of this in a middleware.
public class EasyCachingMiddleware { private readonly RequestDelegate _next; private readonly ICacheService _cacheService; public EasyCachingMiddleware(RequestDelegate next, ICacheService cacheService) { _next = next; _cacheService = cacheService; } public async Task Invoke(HttpContext context) { //how to write this method?? } }
1.4m articles
1.4m replys
5 comments
57.0k users