Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

LocaleStringResourceCacheEventConsumer.cs

using Nop.Core.Domain.Localization;
using Nop.Services.Caching;

namespace Nop.Services.Localization.Caching;

/// 
/// Represents a locale string resource cache event consumer
/// 
public partial class LocaleStringResourceCacheEventConsumer : CacheEventConsumer
{
    /// 
    /// Clear cache by entity event type
    /// 
    /// Entity
    /// A task that represents the asynchronous operation
    protected override async Task ClearCacheAsync(LocaleStringResource entity)
    {
        await RemoveAsync(NopLocalizationDefaults.LocaleStringResourcesAllPublicCacheKey, entity.LanguageId);
        await RemoveAsync(NopLocalizationDefaults.LocaleStringResourcesAllAdminCacheKey, entity.LanguageId);
        await RemoveAsync(NopLocalizationDefaults.LocaleStringResourcesAllCacheKey, entity.LanguageId);
        await RemoveByPrefixAsync(NopLocalizationDefaults.LocaleStringResourcesByNamePrefix, entity.LanguageId);
    }
}