static IChildProjection LazyChild <K, V>(Expression projector, Scope scope, LookupToken token, SqlPreCommandSimple command) where K : notnull { var proj = ProjectionBuilder.Build <KeyValuePair <K, MList <V> .RowIdElement> >(projector, scope); return(new LazyChildProjection <K, V>(token, command, proj)); }
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]); } }
static IChildProjection EagerChild <K, V>(Expression projector, Scope scope, LookupToken token, SqlPreCommandSimple command) { var proj = ProjectionBuilder.Build <KeyValuePair <K, V> >(projector, scope); return(new EagerChildProjection <K, V>(token, command, proj)); }
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; }