Beispiel #1
0
        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));
        }
Beispiel #2
0
        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>()));
        }
Beispiel #3
0
 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]);
            }
        }
Beispiel #5
0
        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));
        }
Beispiel #6
0
 public EagerChildProjection(LookupToken token, SqlPreCommandSimple command, Expression <Func <IProjectionRow, KeyValuePair <K, V> > > projectorExpression)
 {
     Token               = token;
     Command             = command;
     ProjectorExpression = projectorExpression;
 }
Beispiel #7
0
 public LazyChildProjection(LookupToken token, SqlPreCommandSimple command, Expression <Func <IProjectionRow, KeyValuePair <K, MList <V> .RowIdElement> > > projectorExpression)
 {
     Token               = token;
     Command             = command;
     ProjectorExpression = projectorExpression;
 }