Exemplo n.º 1
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));
 }
Exemplo n.º 2
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));
 }
Exemplo n.º 3
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));
        }
Exemplo n.º 4
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));
 }
Exemplo n.º 5
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));
        }
Exemplo n.º 6
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));
 }
Exemplo n.º 7
0
 /// <summary>
 /// Loads the specified ids.
 /// </summary>
 Lazy <Task <T[]> > IAsyncLazySessionOperations.LoadAsync <T>(IEnumerable <string> ids)
 {
     return(Lazily.LoadAsync <T>(ids, null));
 }
Exemplo n.º 8
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));
 }
Exemplo n.º 9
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));
        }