mirror of https://github.com/abpframework/abp.git
3 changed files with 23 additions and 22 deletions
@ -1,22 +1,22 @@ |
|||||
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; |
||||
|
|
||||
public class EntityCacheWithObjectMapperContext<TObjectMapperContext, TEntity, TEntityCacheItem, TKey> : |
public class EntityCacheWithObjectMapperContext<TObjectMapperContext, TEntity, TEntityCacheItem, TKey> : |
||||
EntityCacheWithObjectMapper<TEntity, TEntityCacheItem, TKey> |
EntityCacheWithObjectMapper<TEntity, TEntityCacheItem, TKey> |
||||
where TEntity : Entity<TKey> |
where TEntity : Entity<TKey> |
||||
where TEntityCacheItem : class |
where TEntityCacheItem : class |
||||
{ |
{ |
||||
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,24 +1,25 @@ |
|||||
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; |
||||
|
|
||||
public class EntityCacheWithoutCacheItem<TEntity, TKey> : |
public class EntityCacheWithoutCacheItem<TEntity, TKey> : |
||||
EntityCacheBase<TEntity, TEntity, TKey> |
EntityCacheBase<TEntity, TEntity, TKey> |
||||
where TEntity : Entity<TKey> |
where TEntity : Entity<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…
Reference in new issue