You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using Connected.Entities.Caching;
|
|
|
|
|
|
|
|
|
|
namespace Common.Types.TaxRates;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// This is the contract for the typed cache. Using contracts for
|
|
|
|
|
/// caching is useful when writing unit tests so a developer
|
|
|
|
|
/// can mock the entire cache.
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal interface ITaxRateCache : IEntityCacheClient<TaxRate, int> { }
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Cache for the <see cref="ITaxRate"/> entity.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// <see cref="EntityCacheClient{TEntity, TPrimaryKey}"/> stores the entire set
|
|
|
|
|
/// of records in the database. This is useful for data which doesn't change
|
|
|
|
|
/// frequently because invalidating it ofter can have performance penalties.
|
|
|
|
|
/// The platform knows how to load and invalidate the entity so developer
|
|
|
|
|
/// doesn't nedd to write any code at all.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
internal sealed class TaxRateCache : EntityCacheClient<TaxRate, int>, ITaxRateCache
|
|
|
|
|
{
|
|
|
|
|
public TaxRateCache(IEntityCacheContext context) : base(context, TaxRate.CacheKey)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|