Пример #1
0
        /// <summary>
        /// Fetches the entity set.
        /// </summary>
        /// <param name="ownerKey">The owner key.</param>
        /// <param name="field">The field.</param>
        public override void FetchEntitySet(Key ownerKey, FieldInfo field, int?itemCountLimit)
        {
            var ownerType   = ownerKey.TypeReference.Type;
            var descriptor  = new PrefetchFieldDescriptor(field, itemCountLimit);
            var descriptors = new List <PrefetchFieldDescriptor> {
                descriptor
            };

            Session.Handler.Prefetch(ownerKey, ownerType, descriptors);
            Session.Handler.ExecutePrefetchTasks();
        }
Пример #2
0
        /// <summary>
        /// Fetches the field of an <see cref="Entity"/>.
        /// </summary>
        /// <param name="key">The key.</param>
        /// <param name="field">The field to fetch.</param>
        public override void FetchField(Key key, FieldInfo field)
        {
            var type        = key.TypeReference.Type;
            var descriptor  = new PrefetchFieldDescriptor(field, false, false);
            var descriptors = new List <PrefetchFieldDescriptor> {
                descriptor
            };

            prefetchManager.Prefetch(key, type, descriptors);
            prefetchManager.ExecuteTasks(true);
        }