public MList <S> LookupRequest <K, S>(LookupToken token, K key, MList <S> field) where K : notnull { Dictionary <K, MList <S> > dictionary = (Dictionary <K, MList <S> >)lookups.GetOrCreate(token, () => (IEnumerable) new Dictionary <K, MList <S> >()); return(dictionary.GetOrCreate(key, () => field != null && field.Count == 0 ? field : new MList <S>())); }
internal ChildProjectionExpression(ProjectionExpression projection, Expression outerKey, bool isLazyMList, Type type, LookupToken token) : base(DbExpressionType.ChildProjection, type) { this.Projection = projection; this.OuterKey = outerKey; this.IsLazyMList = isLazyMList; this.Token = token; }
public IEnumerable <S> Lookup <K, S>(LookupToken token, K key) { Lookup <K, S> lookup = (Lookup <K, S>)lookups[token]; if (!lookup.Contains(key)) { return(Enumerable.Empty <S>()); } else { return(lookup[key]); } }
public async IAsyncEnumerable <NuGetReference> SearchAsync(string path, IEnumerable <TargetFrameworkMoniker> tfms, [EnumeratorCancellation] CancellationToken token) { var lookupToken = LookupToken.Create(path) !; if (!lookupToken.HasValue) { _logger.LogWarning("Could not create a lookup token for {Path}", path); yield break; } foreach (var index in _indexes.Value) { index.FindNuGetPackageInfo(lookupToken.Value, out var ownerPackageId, out var containingPackage); var result = (ownerPackageId, containingPackage) switch { { containingPackage : { Id : var id }, } when string.Equals(id, ownerPackageId, StringComparison.OrdinalIgnoreCase) => GetNuGetReference(containingPackage), { containingPackage : { Id : var id }, ownerPackageId : not null
public MList <S> LookupRequest <K, S>(LookupToken token, K key, MList <S> field) where K : notnull { throw new InvalidOperationException("Subqueries can not be used on simple queries"); }
public IEnumerable <S> Lookup <K, S>(LookupToken token, K key) { throw new InvalidOperationException("Subqueries can not be used on simple queries"); }
public EagerChildProjection(LookupToken token, SqlPreCommandSimple command, Expression <Func <IProjectionRow, KeyValuePair <K, V> > > projectorExpression) { Token = token; Command = command; ProjectorExpression = projectorExpression; }
public LazyChildProjection(LookupToken token, SqlPreCommandSimple command, Expression <Func <IProjectionRow, KeyValuePair <K, MList <V> .RowIdElement> > > projectorExpression) { Token = token; Command = command; ProjectorExpression = projectorExpression; }