public CustomComparatorSource(string sorterName, string databaseName, IndexQueryServerSide query) { _query = query; _factory = SorterCompilationCache.Instance.GetItemType(sorterName, databaseName); if (_factory == null) { SorterDoesNotExistException.ThrowFor(sorterName); } }
public static CreateSorter GetSorter(string name, string databaseName) { var key = new CacheKey(databaseName, name, null); if (SortersPerDatabaseCache.TryGetValue(key, out var result) == false) { SorterDoesNotExistException.ThrowFor(name); } try { return(result.Value); } catch (Exception) { SortersPerDatabaseCache.TryRemove(key, out _); throw; } }