maliming 3 years ago
parent 18fb3b2069
commit 3fa985e923

@ -2,6 +2,7 @@
using Volo.Abp.Caching; using Volo.Abp.Caching;
using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Repositories;
using Volo.Abp.ObjectMapping; using Volo.Abp.ObjectMapping;
using Volo.Abp.Uow;
namespace Volo.Abp.Domain.Entities.Caching; namespace Volo.Abp.Domain.Entities.Caching;
@ -15,10 +16,9 @@ public class EntityCacheWithObjectMapper<TEntity, TEntityCacheItem, TKey> :
public EntityCacheWithObjectMapper( public EntityCacheWithObjectMapper(
IReadOnlyRepository<TEntity, TKey> repository, IReadOnlyRepository<TEntity, TKey> repository,
IDistributedCache<TEntityCacheItem, TKey> cache, IDistributedCache<TEntityCacheItem, TKey> cache,
IUnitOfWorkManager unitOfWorkManager,
IObjectMapper objectMapper) IObjectMapper objectMapper)
: base( : base(repository, cache, unitOfWorkManager)
repository,
cache)
{ {
ObjectMapper = objectMapper; ObjectMapper = objectMapper;
} }

@ -1,6 +1,7 @@
using Volo.Abp.Caching; using Volo.Abp.Caching;
using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Repositories;
using Volo.Abp.ObjectMapping; using Volo.Abp.ObjectMapping;
using Volo.Abp.Uow;
namespace Volo.Abp.Domain.Entities.Caching; namespace Volo.Abp.Domain.Entities.Caching;
@ -12,11 +13,10 @@ public class EntityCacheWithObjectMapperContext<TObjectMapperContext, TEntity, T
public EntityCacheWithObjectMapperContext( public EntityCacheWithObjectMapperContext(
IReadOnlyRepository<TEntity, TKey> repository, IReadOnlyRepository<TEntity, TKey> repository,
IDistributedCache<TEntityCacheItem, TKey> cache, IDistributedCache<TEntityCacheItem, TKey> cache,
IObjectMapper<TObjectMapperContext> objectMapper) // Intentionally injected with TContext IUnitOfWorkManager unitOfWorkManager,
: base( IObjectMapper objectMapper)// Intentionally injected with TContext
repository, : base(repository, cache, unitOfWorkManager, objectMapper)
cache,
objectMapper)
{ {
} }
} }

@ -1,5 +1,6 @@
using Volo.Abp.Caching; using Volo.Abp.Caching;
using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Repositories;
using Volo.Abp.Uow;
namespace Volo.Abp.Domain.Entities.Caching; namespace Volo.Abp.Domain.Entities.Caching;
@ -9,16 +10,16 @@ public class EntityCacheWithoutCacheItem<TEntity, TKey> :
{ {
public EntityCacheWithoutCacheItem( public EntityCacheWithoutCacheItem(
IReadOnlyRepository<TEntity, TKey> repository, IReadOnlyRepository<TEntity, TKey> repository,
IDistributedCache<TEntity, TKey> cache) IDistributedCache<TEntity, TKey> cache,
: base( IUnitOfWorkManager unitOfWorkManager)
repository, : base(repository, cache, unitOfWorkManager)
cache)
{ {
} }
protected override TEntity MapToCacheItem(TEntity entity) protected override TEntity MapToCacheItem(TEntity entity)
{ {
return entity; return entity;
} }
} }
Loading…
Cancel
Save