dotnetcore / EasyCaching

:boom: EasyCaching is an open source caching library that contains basic usages and some advanced usages of caching which can help us to handle caching more easier!
MIT License
1.92k stars 321 forks source link

When EnableReadDeepClone is true HashSet method Remove fails #481

Open jkatsiotis opened 1 year ago

jkatsiotis commented 1 year ago

Description

When you store a HashSet object in MemoryCache and retrieve the object when you are trying to remove an item from the collection operations fail.

Steps to Reproduce

  1. Create a HashSet with 2 items
  2. Store it in MemoryCache with EnableReadDeepClone = true
  3. Retrieve it from Cache
  4. Remove the 1st item
  5. Item is not being removed

Expected behavior: .Remove() method should work as expected

Actual behavior: .Remove() method returns false

Workaround: Implement GetHashCode() of the object that is inside the HashSet

Specifications

jkatsiotis commented 1 year ago

This is possibly related with that one: https://github.com/force-net/DeepCloner/issues/17