コード例 #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));
        }
コード例 #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>()));
        }
コード例 #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;
 }
コード例 #4
0
        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]);
            }
        }
コード例 #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));
        }
コード例 #6
0
ファイル: TranslateResult.cs プロジェクト: zeevir/framework
 public EagerChildProjection(LookupToken token, SqlPreCommandSimple command, Expression <Func <IProjectionRow, KeyValuePair <K, V> > > projectorExpression)
 {
     Token               = token;
     Command             = command;
     ProjectorExpression = projectorExpression;
 }
コード例 #7
0
ファイル: TranslateResult.cs プロジェクト: zeevir/framework
 public LazyChildProjection(LookupToken token, SqlPreCommandSimple command, Expression <Func <IProjectionRow, KeyValuePair <K, MList <V> .RowIdElement> > > projectorExpression)
 {
     Token               = token;
     Command             = command;
     ProjectorExpression = projectorExpression;
 }