Add "inTunnel" property on JumpType

This commit is contained in:
Sébastien ANDRE
2023-08-18 09:47:37 +02:00
parent 01fa8b60d0
commit b28bd7e7ff
6 changed files with 48 additions and 13 deletions

View File

@@ -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();