コード例 #1
0
ファイル: DocumentSession.cs プロジェクト: ybdev/ravendb
 /// <summary>
 /// Loads the specified ids.
 /// </summary>
 Lazy <T[]> ILazySessionOperations.Load <T>(IEnumerable <string> ids)
 {
     return(Lazily.Load <T>(ids, null));
 }
コード例 #2
0
 /// <summary>
 /// Loads the specified entities with the specified id after applying
 /// conventions on the provided id to get the real document id.
 /// </summary>
 /// <remarks>
 /// This method allows you to call:
 /// Load{Post}(1)
 /// And that call will internally be translated to
 /// Load{Post}("posts/1");
 ///
 /// Or whatever your conventions specify.
 /// </remarks>
 Lazy <Task <T> > IAsyncLazySessionOperations.LoadAsync <T>(ValueType id, CancellationToken token)
 {
     return(Lazily.LoadAsync(id, (Action <T>)null, token));
 }
コード例 #3
0
 /// <summary>
 /// Loads the specified ids.
 /// </summary>
 /// <param name="token">The cancellation token.</param>
 /// <param name="ids">The ids of the documents to load.</param>
 Lazy <Task <T[]> > IAsyncLazySessionOperations.LoadAsync <T>(IEnumerable <string> ids, CancellationToken token)
 {
     return(Lazily.LoadAsync <T>(ids, null, token));
 }
コード例 #4
0
        Lazy <TResult> ILazySessionOperations.Load <TTransformer, TResult>(string id, Action <TResult> onEval)
        {
            var lazy = Lazily.Load <TTransformer, TResult>(new[] { id });

            return(new Lazy <TResult>(() => lazy.Value[0]));
        }
コード例 #5
0
 Lazy <Task <TResult> > IAsyncLazySessionOperations.LoadAsync <TTransformer, TResult>(string id, Action <ILoadConfiguration> configure, Action <TResult> onEval, CancellationToken token)
 {
     return(Lazily.LoadAsync(id, typeof(TTransformer), configure, onEval, token));
 }
コード例 #6
0
        /// <summary>
        /// Loads the specified entities with the specified id after applying
        /// conventions on the provided id to get the real document id.
        /// </summary>
        /// <remarks>
        /// This method allows you to call:
        /// Load{Post}(1)
        /// And that call will internally be translated to
        /// Load{Post}("posts/1");
        ///
        /// Or whatever your conventions specify.
        /// </remarks>
        Lazy <T> ILazySessionOperations.Load <T>(ValueType id, Action <T> onEval)
        {
            var documentKey = Conventions.FindFullDocumentKeyFromNonStringIdentifier(id, typeof(T), false);

            return(Lazily.Load(documentKey, onEval));
        }
コード例 #7
0
 Lazy <TResult[]> ILazySessionOperations.Load <TTransformer, TResult>(IEnumerable <string> ids, Action <ILoadConfiguration> configure, Action <TResult> onEval)
 {
     return(Lazily.Load(ids, typeof(TTransformer), configure, onEval));
 }
コード例 #8
0
 /// <summary>
 /// Loads the specified id.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="id">The id.</param>
 /// <returns></returns>
 Lazy <Task <T> > IAsyncLazySessionOperations.LoadAsync <T>(string id, CancellationToken token = default(CancellationToken))
 {
     return(Lazily.LoadAsync(id, (Action <T>)null, token));
 }
コード例 #9
0
 /// <summary>
 /// Loads the specified ids.
 /// </summary>
 Lazy <Dictionary <string, T> > ILazySessionOperations.Load <T>(IEnumerable <string> ids)
 {
     return(Lazily.Load <T>(ids, null));
 }
コード例 #10
0
 /// <summary>
 /// Loads the specified entities with the specified id after applying
 /// conventions on the provided id to get the real document id.
 /// </summary>
 /// <remarks>
 /// This method allows you to call:
 /// Load{Post}(1)
 /// And that call will internally be translated to
 /// Load{Post}("posts/1");
 ///
 /// Or whatever your conventions specify.
 /// </remarks>
 Lazy <Task <T> > IAsyncLazySessionOperations.LoadAsync <T>(ValueType id)
 {
     return(Lazily.LoadAsync(id, (Action <T>)null));
 }
コード例 #11
0
 /// <summary>
 /// Loads the specified ids.
 /// </summary>
 Lazy <Task <T[]> > IAsyncLazySessionOperations.LoadAsync <T>(IEnumerable <string> ids)
 {
     return(Lazily.LoadAsync <T>(ids, null));
 }
コード例 #12
0
        Lazy <Task <T[]> > IAsyncLazySessionOperations.LoadAsync <T>(params ValueType[] ids)
        {
            var documentKeys = ids.Select(id => Conventions.FindFullDocumentKeyFromNonStringIdentifier(id, typeof(T), false));

            return(Lazily.LoadAsync <T>(documentKeys, null));
        }
コード例 #13
0
        /// <summary>
        /// Loads the specified entities with the specified id after applying
        /// conventions on the provided id to get the real document id.
        /// </summary>
        /// <remarks>
        /// This method allows you to call:
        /// Load{Post}(1)
        /// And that call will internally be translated to
        /// Load{Post}("posts/1");
        ///
        /// Or whatever your conventions specify.
        /// </remarks>
        public Lazy <TResult> Load <TResult>(ValueType id, Action <TResult> onEval)
        {
            var documentKey = Conventions.FindFullDocumentKeyFromNonStringIdentifier(id, typeof(TResult), false);

            return(Lazily.Load <TResult>(documentKey));
        }
コード例 #14
0
 /// <summary>
 /// Loads the specified entities with the specified id after applying
 /// conventions on the provided id to get the real document id.
 /// </summary>
 /// <remarks>
 /// This method allows you to call:
 /// Load{Post}(1)
 /// And that call will internally be translated to
 /// Load{Post}("posts/1");
 ///
 /// Or whatever your conventions specify.
 /// </remarks>
 Lazy <TResult> ILazySessionOperations.Load <TResult>(ValueType id)
 {
     return(Lazily.Load <TResult>(id, null));
 }
コード例 #15
0
ファイル: DocumentSession.cs プロジェクト: ybdev/ravendb
 /// <summary>
 /// Loads the specified ids.
 /// </summary>
 /// <param name="ids">The ids.</param>
 Lazy <T[]> ILazySessionOperations.Load <T>(params string[] ids)
 {
     return(Lazily.Load <T>(ids, null));
 }
コード例 #16
0
        Lazy <TResult> ILazySessionOperations.Load <TResult>(string id, Type transformerType, Action <ILoadConfiguration> configure, Action <TResult> onEval)
        {
            var lazy = Lazily.Load(new[] { id }, transformerType, configure, onEval);

            return(new Lazy <TResult>(() => lazy.Value[0]));
        }
コード例 #17
0
 /// <summary>
 /// Loads the specified id.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="id">The id.</param>
 /// <returns></returns>
 Lazy <T> ILazySessionOperations.Load <T>(string id)
 {
     return(Lazily.Load(id, (Action <T>)null));
 }
コード例 #18
0
        /// <summary>
        /// Loads the specified entities with the specified id after applying
        /// conventions on the provided id to get the real document id.
        /// </summary>
        /// <remarks>
        /// This method allows you to call:
        /// Load{Post}(1)
        /// And that call will internally be translated to
        /// Load{Post}("posts/1");
        ///
        /// Or whatever your conventions specify.
        /// </remarks>
        Lazy <Task <T> > IAsyncLazySessionOperations.LoadAsync <T>(ValueType id, Action <T> onEval, CancellationToken token)
        {
            var documentKey = Conventions.FindFullDocumentKeyFromNonStringIdentifier(id, typeof(T), false);

            return(Lazily.LoadAsync(documentKey, onEval, token));
        }
コード例 #19
0
        Lazy <T[]> ILazySessionOperations.Load <T>(IEnumerable <ValueType> ids)
        {
            var documentKeys = ids.Select(id => Conventions.FindFullDocumentKeyFromNonStringIdentifier(id, typeof(T), false));

            return(Lazily.Load <T>(documentKeys));
        }
コード例 #20
0
        Lazy <Task <T[]> > IAsyncLazySessionOperations.LoadAsync <T>(IEnumerable <ValueType> ids, CancellationToken token)
        {
            var documentKeys = ids.Select(id => Conventions.FindFullDocumentKeyFromNonStringIdentifier(id, typeof(T), false));

            return(Lazily.LoadAsync <T>(documentKeys, null, token));
        }
コード例 #21
0
 /// <summary>
 /// Loads the specified entities with the specified id after applying
 /// conventions on the provided id to get the real document id.
 /// </summary>
 /// <remarks>
 /// This method allows you to call:
 /// Load{Post}(1)
 /// And that call will internally be translated to
 /// Load{Post}("posts/1");
 ///
 /// Or whatever your conventions specify.
 /// </remarks>
 Lazy <T> ILazySessionOperations.Load <T>(ValueType id)
 {
     return(Lazily.Load(id, (Action <T>)null));
 }
コード例 #22
0
 Lazy <TResult> ILazySessionOperations.Load <TTransformer, TResult>(string id, Action <TResult> onEval)
 {
     return(Lazily.Load(id, typeof(TTransformer), onEval));
 }