Пример #1
0
        public TResult[] LoadStartingWith <TTransformer, TResult>(string keyPrefix, string matches = null, int start = 0,
                                                                  int pageSize     = 25, string exclude = null, RavenPagingInformation pagingInformation = null, Action <ILoadConfiguration> configure = null,
                                                                  string skipAfter = null) where TTransformer : AbstractTransformerCreationTask, new()
        {
            IncrementRequestCount();
            var transformer = new TTransformer().TransformerName;

            var configuration = new RavenLoadConfiguration();

            configure?.Invoke(configuration);

            var loadStartingWithOperation = new LoadStartingWithOperation(this);

            loadStartingWithOperation.WithStartWith(keyPrefix, matches, start, pageSize, exclude, pagingInformation, configure, skipAfter);
            loadStartingWithOperation.WithTransformer(transformer, configuration.TransformerParameters);


            var command = loadStartingWithOperation.CreateRequest();

            if (command != null)
            {
                RequestExecuter.Execute(command, Context);
            }

            return(loadStartingWithOperation.GetTransformedDocuments <TResult>(command?.Result));
        }