public static ReferencedRelatedObjectPropertyGathererResults Gather(DataAccessModel model, Expression[] expressions, ParameterExpression sourceParameterExpression, bool forProjection)
        {
            var gatherer = new ReferencedRelatedObjectPropertyGatherer(model, sourceParameterExpression, forProjection);

            var reducedExpressions = expressions.Select(gatherer.Visit).ToArray();

            return new ReferencedRelatedObjectPropertyGathererResults
            {
                ReducedExpressions = reducedExpressions,
                ReferencedRelatedObjectByPath = gatherer.results,
                RootExpressionsByPath = gatherer.rootExpressionsByPath,
                IncludedPropertyInfoByExpression = gatherer
                    .includedPropertyInfos
                    .GroupBy(c => c.RootExpression)
                    .ToDictionary(c => c.Key, c => c.ToList())
            };
        }
예제 #2
0
        public static ReferencedRelatedObjectPropertyGathererResults Gather(DataAccessModel model, Expression[] expressions, ParameterExpression sourceParameterExpression, bool forProjection)
        {
            var gatherer = new ReferencedRelatedObjectPropertyGatherer(model, sourceParameterExpression, forProjection);

            var reducedExpressions = expressions.Select(gatherer.Visit).ToArray();

            return(new ReferencedRelatedObjectPropertyGathererResults
            {
                ReducedExpressions = reducedExpressions,
                ReferencedRelatedObjectByPath = gatherer.results,
                RootExpressionsByPath = gatherer.rootExpressionsByPath,
                IncludedPropertyInfoByExpression = gatherer
                                                   .includedPropertyInfos
                                                   .GroupBy(c => c.RootExpression)
                                                   .ToDictionary(c => c.Key, c => c.ToList())
            });
        }
		public static ReferencedRelatedObjectPropertyGathererResults Gather(DataAccessModel model, IList<Tuple<ParameterExpression, Expression>> expressions, bool forProjection)
		{
			var gatherer = new ReferencedRelatedObjectPropertyGatherer(model, null, forProjection);

			var reducedExpressions = expressions.Select(c =>
			{
				gatherer.sourceParameterExpression = c.Item1;
				return SqlExpressionReplacer.Replace(gatherer.Visit(c.Item2), d => d.StripForIncludeScanning());
			}).ToArray();

			return new ReferencedRelatedObjectPropertyGathererResults
			{
				ReducedExpressions = reducedExpressions,
				ReferencedRelatedObjects = gatherer.results.Values.ToList(),
				RootExpressionsByPath = gatherer.rootExpressionsByPath,
				IncludedPropertyInfoByExpression = gatherer
					.includedPropertyInfos
					.GroupBy(c => c.RootExpression)
					.ToDictionary(c => c.Key, c => c.ToList())
			};
		}
예제 #4
0
        public static ReferencedRelatedObjectPropertyGathererResults Gather(DataAccessModel model, IList <Tuple <ParameterExpression, Expression> > expressions, bool forProjection)
        {
            var gatherer = new ReferencedRelatedObjectPropertyGatherer(model, null, forProjection);

            var reducedExpressions = expressions.Select(c =>
            {
                gatherer.sourceParameterExpression = c.Item1;
                return(SqlExpressionReplacer.Replace(gatherer.Visit(c.Item2), d => d.StripForIncludeScanning()));
            }).ToArray();

            return(new ReferencedRelatedObjectPropertyGathererResults
            {
                ReducedExpressions = reducedExpressions,
                ReferencedRelatedObjects = gatherer.results.Values.ToList(),
                RootExpressionsByPath = gatherer.rootExpressionsByPath,
                IncludedPropertyInfoByExpression = gatherer
                                                   .includedPropertyInfos
                                                   .GroupBy(c => c.RootExpression)
                                                   .ToDictionary(c => c.Key, c => c.ToList())
            });
        }
 public DisableCompareContext(ReferencedRelatedObjectPropertyGatherer gatherer)
 {
     this.gatherer = gatherer;
     this.savedDisableCompare = gatherer.disableCompare;
     gatherer.disableCompare = true;
 }
예제 #6
0
 public DisableCompareContext(ReferencedRelatedObjectPropertyGatherer gatherer)
 {
     this.gatherer            = gatherer;
     this.savedDisableCompare = gatherer.disableCompare;
     gatherer.disableCompare  = true;
 }