예제 #1
0
 /// <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 id.
 /// </summary>
 Lazy <T> ILazySessionOperations.Load <T>(string id)
 {
     return(Lazily.Load(id, (Action <T>)null));
 }
예제 #3
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));
        }
예제 #4
0
 /// <summary>
 /// Loads the specified ids.
 /// </summary>
 /// <param name="ids">The ids.</param>
 Lazy <TResult[]> ILazySessionOperations.Load <TResult>(params string[] ids)
 {
     return(Lazily.Load <TResult>(ids, null));
 }
예제 #5
0
        Lazy <T[]> ILazySessionOperations.Load <T>(params ValueType[] ids)
        {
            var documentKeys = ids.Select(id => Conventions.FindFullDocumentKeyFromNonStringIdentifier(id, typeof(T), false));

            return(Lazily.Load <T>(documentKeys, null));
        }
예제 #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 <TResult> ILazySessionOperations.Load <TResult>(ValueType id)
 {
     return(Lazily.Load <TResult>(id, null));
 }
예제 #7
0
        Lazy <TResult> ILazySessionOperations.Load <TResult>(string id, Type transformerType, Action <TResult> onEval)
        {
            var lazy = Lazily.Load(new[] { id }, transformerType, onEval);

            return(new Lazy <TResult>(() => lazy.Value[0]));
        }
예제 #8
0
 Lazy <TResult[]> ILazySessionOperations.Load <TTransformer, TResult>(IEnumerable <string> ids, Action <TResult> onEval)
 {
     return(Lazily.Load(ids, typeof(TTransformer), onEval));
 }
예제 #9
0
        /// <summary>
        /// Loads the specified entity 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));
        }
예제 #10
0
        Lazy <T[]> ILazySessionOperations.Load <T>(IEnumerable <ValueType> ids, Action <T[]> onEval)
        {
            var documentKeys = ids.Select(id => Conventions.FindFullDocumentKeyFromNonStringIdentifier(id, typeof(T), false));

            return(Lazily.Load(documentKeys, onEval));
        }
예제 #11
0
 /// <summary>
 /// Loads the specified entity 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));
 }
예제 #12
0
 Lazy <TResult> ILazySessionOperations.Load <TTransformer, TResult>(string id, Action <TResult> onEval)
 {
     return(Lazily.Load(id, typeof(TTransformer), onEval));
 }
예제 #13
0
 /// <summary>
 /// Loads the specified ids.
 /// </summary>
 Lazy <Dictionary <string, T> > ILazySessionOperations.Load <T>(IEnumerable <string> ids)
 {
     return(Lazily.Load <T>(ids, null));
 }
예제 #14
0
        Lazy <TResult> ILazySessionOperations.Load <TTransformer, TResult>(string id)
        {
            var lazy = Lazily.Load <TTransformer, TResult>(new[] { id });

            return(new Lazy <TResult>(() => lazy.Value[0]));
        }
예제 #15
0
        Lazy <TResult> ILazySessionOperations.Load <TTransformer, TResult>(string id, Action <ILoadConfiguration> configure, Action <TResult> onEval)
        {
            var lazy = Lazily.Load <TTransformer, TResult>(new[] { id }, configure);

            return(new Lazy <TResult>(() => lazy.Value[0]));
        }