Base solution for your next web application
Open Closed

Example using EntityCache #6818


User avatar
0
antonis created

Hi,

Is there any full example using the EntityCache. The one in the documentation is not full as it contains only the signature of the cache and not how it is implemented (PersonCache).

Also why the PersonCache implemented ITransientDependency. I thought this must be singleton

Thanks in advance


3 Answer(s)
  • User Avatar
    0
    ryancyq created
    Support Team

    Hi, the example in the documentation describe how use EntityCache base on the default implementation in the framework.

    If you want to know more about the implementation, you can always look for the open source repo at https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp/Domain/Entities/Caching/EntityCache.cs

  • User Avatar
    0
    antonis created

    Hi,

    I dont see any actual code rather than method signatures. It does not show how it is actually implemented rather than some snippets.

  • User Avatar
    0
    maliming created
    Support Team

    https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp/Domain/Entities/Caching/EntityCache.cs#L27 EntityCache.cs is all the code.

    Also why the PersonCache implemented ITransientDependency. I thought this must be singleton

    Cache class can be transient or a singleton. This does not mean the cached data is transient. It's always cached globally and accessed in a thread-safe manner in your application.