public async Task <List <TokenDto> > GetCollocations_Async(Guid corpusId, string word, int direction) { var collocations = _cacheRepository.GetCollocations(corpusId, word, direction); if (collocations != null) { return(await collocations); } var xd = await _searchCorpusService.GetAllCollocationsAsync(corpusId, word, direction); _cacheRepository.InsertIntoCache <CollocationsInfo>(corpusId, word, xd); return(await Task.FromResult(xd != null?xd.Collocations : null)); }