Skip to content

Please add a Clear() method #195

@DavidThielen

Description

@DavidThielen

Disposing and then creating a new cache is problematic at times. Having a Clear() method resolves that.

I think adding ICacheProvider.Clear() is the best way to do this. But here is code that works:

       public static void ExClear(this IAppCache service)
       {
        IMemoryCache? provider = service.CacheProvider.GetPrivateFieldValue<IMemoryCache>("cache");
        if (provider is MemoryCache memoryCache)
	        memoryCache.Clear();
           else Trap.Break(); // need to find a solution for this!!!
       }

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions