public CollectionIncludeRelatedValuesStrategy(
     IEnumerable <ValueBuffer> relatedValueBuffers, Func <ValueBuffer, object> materializer)
 {
     _materializer = materializer;
     _includeCollectionIterator
         = new IncludeCollectionIterator(relatedValueBuffers.GetEnumerator());
 }
        private static IEnumerable <TResult> _IncludeCollection <TResult>(
            QueryContext queryContext,
            IEnumerable <TResult> source,
            INavigation navigation,
            IEnumerable <IValueReader> relatedValueReaders,
            Func <TResult, object> accessorLambda)
        {
            using (var relatedValuesIterator
                       = new IncludeCollectionIterator(relatedValueReaders.GetEnumerator()))
            {
                foreach (var result in source)
                {
                    queryContext.QueryBuffer
                    .Include(
                        accessorLambda.Invoke(result),
                        navigation,
                        relatedValuesIterator.GetRelatedValues);

                    yield return(result);
                }
            }
        }
Beispiel #3
0
 public CollectionIncludeRelatedValuesStrategy(IEnumerable <IValueReader> relatedValueReaders)
 {
     _includeCollectionIterator
         = new IncludeCollectionIterator(relatedValueReaders.GetEnumerator());
 }