Пример #1
0
        Lazy <TResult[]> ILazySessionOperations.Load <TTransformer, TResult>(string[] ids)
        {
            var transformer       = new TTransformer().TransformerName;
            var lazyLoadOperation = new LazyTransformerLoadOperation <TResult>(ids, transformer,
                                                                               new LoadTransformerOperation(this, transformer, ids),
                                                                               singleResult: false);

            return(AddLazyOperation <TResult[]>(lazyLoadOperation, null));
        }
Пример #2
0
        Lazy <TResult[]> ILazySessionOperations.Load <TResult>(IEnumerable <string> ids, Type transformerType, Action <TResult> onEval)
        {
            var idsArray          = ids.ToArray();
            var transformer       = ((AbstractTransformerCreationTask)Activator.CreateInstance(transformerType)).TransformerName;
            var lazyLoadOperation = new LazyTransformerLoadOperation <TResult>(idsArray, transformer,
                                                                               new LoadTransformerOperation(this, transformer, idsArray),
                                                                               singleResult: false);

            return(AddLazyOperation <TResult[]>(lazyLoadOperation, null));
        }
Пример #3
0
        Lazy <TResult[]> ILazySessionOperations.Load <TTransformer, TResult>(IEnumerable <string> ids, Action <TResult> onEval)
        {
            var idsArray          = ids.ToArray();
            var transformer       = new TTransformer().TransformerName;
            var lazyLoadOperation = new LazyTransformerLoadOperation <TResult>(idsArray, transformer,
                                                                               new LoadTransformerOperation(this, transformer, idsArray),
                                                                               singleResult: false);

            return(AddLazyOperation <TResult[]>(lazyLoadOperation, null));
        }
Пример #4
0
        Lazy <TResult> ILazySessionOperations.Load <TResult>(string id, Type transformerType, Action <TResult> onEval)
        {
            var transformer       = ((AbstractTransformerCreationTask)Activator.CreateInstance(transformerType)).TransformerName;
            var idsArray          = new[] { id };
            var lazyLoadOperation = new LazyTransformerLoadOperation <TResult>(idsArray, transformer,
                                                                               new LoadTransformerOperation(this, transformer, idsArray),
                                                                               singleResult: true);

            return(AddLazyOperation(lazyLoadOperation, onEval));
        }
Пример #5
0
        Lazy <TResult> ILazySessionOperations.Load <TTransformer, TResult>(string id, Action <TResult> onEval)
        {
            var transformer       = new TTransformer().TransformerName;
            var ids               = new[] { id };
            var lazyLoadOperation = new LazyTransformerLoadOperation <TResult>(ids, transformer,
                                                                               new LoadTransformerOperation(this, transformer, ids),
                                                                               singleResult: true);

            return(AddLazyOperation(lazyLoadOperation, onEval));
        }
Пример #6
0
        Lazy <TResult[]> ILazySessionOperations.Load <TTransformer, TResult>(params string[] ids)
        {
            var cmds = GetCommandsToOperateOn(new ShardRequestData
            {
                Keys       = ids,
                EntityType = typeof(TTransformer)
            });
            var transformer = new TTransformer().TransformerName;
            var op          = new LoadTransformerOperation(this, transformer, ids);

            var lazyLoadOperation = new LazyTransformerLoadOperation <TResult>(ids, transformer, op, false);

            return(AddLazyOperation <TResult[]>(lazyLoadOperation, null, cmds));
        }
Пример #7
0
        Lazy <TResult[]> ILazySessionOperations.Load <TResult>(IEnumerable <string> ids, Type transformerType, Action <TResult> onEval)
        {
            var idsArray = ids.ToArray();
            var cmds     = GetCommandsToOperateOn(new ShardRequestData
            {
                Keys       = idsArray,
                EntityType = transformerType
            });

            var transformer = ((AbstractTransformerCreationTask)Activator.CreateInstance(transformerType)).TransformerName;
            var op          = new LoadTransformerOperation(this, transformer, idsArray);

            var lazyLoadOperation = new LazyTransformerLoadOperation <TResult>(idsArray, transformer, op, false);

            return(AddLazyOperation <TResult[]>(lazyLoadOperation, null, cmds));
        }
Пример #8
0
        Lazy <TResult> ILazySessionOperations.Load <TResult>(string id, Type transformerType, Action <ILoadConfiguration> configure, Action <TResult> onEval)
        {
            var transformer   = ((AbstractTransformerCreationTask)Activator.CreateInstance(transformerType)).TransformerName;
            var ids           = new[] { id };
            var configuration = new RavenLoadConfiguration();

            if (configure != null)
            {
                configure(configuration);
            }

            var lazyLoadOperation = new LazyTransformerLoadOperation <TResult>(
                ids,
                transformer,
                configuration.TransformerParameters,
                new LoadTransformerOperation(this, transformer, ids),
                singleResult: true);

            return(AddLazyOperation(lazyLoadOperation, onEval));
        }
Пример #9
0
        Lazy <TResult> ILazySessionOperations.Load <TTransformer, TResult>(string id, Action <ILoadConfiguration> configure, Action <TResult> onEval)
        {
            var transformer   = new TTransformer().TransformerName;
            var ids           = new[] { id };
            var configuration = new RavenLoadConfiguration();

            if (configure != null)
            {
                configure(configuration);
            }

            var lazyLoadOperation = new LazyTransformerLoadOperation <TResult>(
                ids,
                transformer,
                configuration.TransformerParameters,
                new LoadTransformerOperation(this, transformer, ids),
                singleResult: true);

            return(AddLazyOperation(lazyLoadOperation, onEval));
        }