Exemple #1
0
 /// <summary>
 /// Loads the specified ids.
 /// </summary>
 Lazy <T[]> ILazySessionOperations.Load <T>(IEnumerable <string> ids)
 {
     return(Lazily.Load <T>(ids, null));
 }
Exemple #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));
 }
Exemple #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));
 }
Exemple #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]));
        }
Exemple #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));
 }
        /// <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));
        }
 Lazy <TResult[]> ILazySessionOperations.Load <TTransformer, TResult>(IEnumerable <string> ids, Action <ILoadConfiguration> configure, Action <TResult> onEval)
 {
     return(Lazily.Load(ids, typeof(TTransformer), configure, onEval));
 }
Exemple #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));
 }
Exemple #9
0
 /// <summary>
 /// Loads the specified ids.
 /// </summary>
 Lazy <Dictionary <string, T> > ILazySessionOperations.Load <T>(IEnumerable <string> ids)
 {
     return(Lazily.Load <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));
 }
 /// <summary>
 /// Loads the specified ids.
 /// </summary>
 Lazy <Task <T[]> > IAsyncLazySessionOperations.LoadAsync <T>(IEnumerable <string> ids)
 {
     return(Lazily.LoadAsync <T>(ids, 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));
        }
Exemple #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));
        }
Exemple #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));
 }
Exemple #15
0
 /// <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));
 }
Exemple #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]));
        }
 /// <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));
 }
Exemple #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));
        }
        Lazy <T[]> ILazySessionOperations.Load <T>(IEnumerable <ValueType> ids)
        {
            var documentKeys = ids.Select(id => Conventions.FindFullDocumentKeyFromNonStringIdentifier(id, typeof(T), false));

            return(Lazily.Load <T>(documentKeys));
        }
Exemple #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));
        }
 /// <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));
 }
 Lazy <TResult> ILazySessionOperations.Load <TTransformer, TResult>(string id, Action <TResult> onEval)
 {
     return(Lazily.Load(id, typeof(TTransformer), onEval));
 }