0
antonis created
Hi,
EntityCache is a singleton class. I saw the code of abp and noticed that a IRepository is injected into EntityCache. Since entitycache is singleton and dependency is scoped these would lead to captive dependency and even worse the same repository instance will be used by whatever other service is registered as singleton and uses that repository. Eventually this would cause bigger problems since dbcontext is not thread safe.
Can you advise?
Thanks
3 Answer(s)
-
0
-
0
If it is a transient how it is caching then since every request has its own PersonCache?
-
1
Because the ICacheManager used internally is a singleton.