Beispiel #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));
 }
Beispiel #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));
 }
Beispiel #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));
        }
Beispiel #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));
 }
Beispiel #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));
        }
Beispiel #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));
 }
 /// <summary>
 /// Loads the specified ids.
 /// </summary>
 Lazy <Task <T[]> > IAsyncLazySessionOperations.LoadAsync <T>(IEnumerable <string> ids)
 {
     return(Lazily.LoadAsync <T>(ids, null));
 }
 /// <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));
 }
        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));
        }