public List <UserEntity> GetAllUsers() { try { var users = _userEngine.GetAllUsersFromCache(); if (users.Count > 0) { return(users); } users = _userEngine.GetAllUsers(); if (users.Count == 0) { throw new Exception("No users in DB!"); } Task.Run(() => { _userEngine.OverrideUsersCache(users); }); return(users); } catch (Exception e) { _exceptionHandlerLogic.LogExceptionAsync(e); throw e; } }