public async override Task Invoke(AspectContext context, AspectDelegate next) { var cachedRemoveConfigurationProvider = context.ServiceProvider.GetService <IOptionsMonitor <FilterCachedConfiguration> >(); var configCacheRemove = context.GetCacheRemoveConfigurationByMethodName(cachedRemoveConfigurationProvider.CurrentValue); if (configCacheRemove != null) { ResponseCacheService = context.ServiceProvider.GetService <IResponseCacheService>(); await ResponseCacheService .RemoveCachedResponseByNamesAsync(configCacheRemove.PatternMethodCachedName); } await next(context); }