Add "inTunnel" property on JumpType
This commit is contained in:
@@ -13,6 +13,8 @@ namespace skydiveLogs_api.DomainBusiness.Interfaces
|
||||
|
||||
IEnumerable<JumpType> GetAllJumpTypes();
|
||||
|
||||
IEnumerable<JumpType> GetJumpTypesForTunnel();
|
||||
|
||||
JumpType GetJumpTypeById(int id);
|
||||
|
||||
void UpdateJumpType(int id, JumpType value);
|
||||
|
||||
@@ -43,6 +43,17 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
return _cacheService.Get<IEnumerable<JumpType>>(CacheType.JumpType);
|
||||
}
|
||||
|
||||
public IEnumerable<JumpType> GetJumpTypesForTunnel()
|
||||
{
|
||||
if (!_cacheService.Contains(CacheType.JumpType))
|
||||
{
|
||||
var tmp = _jumpTypeRepository.GetAll().Where(t => t.InTunnel);
|
||||
_cacheService.Put(CacheType.TunnelJumpType, tmp, 5 * 60 * 1000);
|
||||
}
|
||||
|
||||
return _cacheService.Get<IEnumerable<JumpType>>(CacheType.TunnelJumpType);
|
||||
}
|
||||
|
||||
public JumpType GetJumpTypeById(int id)
|
||||
{
|
||||
var allJumpTypes = GetAllJumpTypes();
|
||||
|
||||
Reference in New Issue
Block a user