Base solution for your next web application
Open Closed

Extending the Tenant entity and save new property in cache #12321


User avatar
0
JapNolt created

We have extended the Tenant entity with a new property. We now would then like to access this property in the ITenantCache. Can you give guidance how to do this?


1 Answer(s)
  • User Avatar
    0
    m.aliozkaya created
    Support Team

    Hi @JapNolt,

    You should update TenantCacheItem

    [Serializable]
    public class CustomTenantCacheItem : TenantCacheItem
    {
    
        // new property
        public string CustomProperty { get; set; }
    }
    

    Then create and use your own custom cache instead of the ones here.

    https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.Zero.Common/MultiTenancy/ITenantCache.cs#L5

    https://github.com/aspnetboilerplate/aspnetboilerplate/blob/679d9fb8722cda5da82bffcda31b0de2f06fa3a1/src/Abp.Zero.Common/MultiTenancy/TenantCache.cs#L12