Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataEntity / System / Data / Objects / ELinq / ReflectionUtil.cs / 2 / ReflectionUtil.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] //--------------------------------------------------------------------- using System.Reflection; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Text; using System.Globalization; namespace System.Data.Objects.ELinq { ////// Static utility class for identifying methods in Queryable, Sequence, and IEnumerable /// and /// internal static class ReflectionUtil { #region Static information on sequence methods private static readonly Dictionarys_methodMap; private static readonly Dictionary s_inverseMap; // Initialize method map static ReflectionUtil() { // register known canonical method names Dictionary map = new Dictionary (); // // DO NOT MODIFY CODE BELOW THIS LINE: CODE GEN TOOL DEPENDS ON THE REGION TAG // #region Code generated by ReflectionUtilCodeGen tool map.Add(@"Sum(IQueryable`1 , Expression`1 >)->Double", SequenceMethod.SumDoubleSelector); map.Add(@"Sum(IQueryable`1 , Expression`1 >>)->Nullable`1 ", SequenceMethod.SumNullableDoubleSelector); map.Add(@"Sum(IQueryable`1 , Expression`1 >)->Decimal", SequenceMethod.SumDecimalSelector); map.Add(@"Sum(IQueryable`1 , Expression`1 >>)->Nullable`1 ", SequenceMethod.SumNullableDecimalSelector); map.Add(@"Average(IQueryable`1 , Expression`1 >)->Double", SequenceMethod.AverageIntSelector); map.Add(@"Average(IQueryable`1 , Expression`1 >>)->Nullable`1 ", SequenceMethod.AverageNullableIntSelector); map.Add(@"Average(IQueryable`1 , Expression`1 >)->Single", SequenceMethod.AverageSingleSelector); map.Add(@"Average(IQueryable`1 , Expression`1 >>)->Nullable`1 ", SequenceMethod.AverageNullableSingleSelector); map.Add(@"Average(IQueryable`1 , Expression`1 >)->Double", SequenceMethod.AverageLongSelector); map.Add(@"Average(IQueryable`1 , Expression`1 >>)->Nullable`1 ", SequenceMethod.AverageNullableLongSelector); map.Add(@"Average(IQueryable`1 , Expression`1 >)->Double", SequenceMethod.AverageDoubleSelector); map.Add(@"Average(IQueryable`1 , Expression`1 >>)->Nullable`1 ", SequenceMethod.AverageNullableDoubleSelector); map.Add(@"Average(IQueryable`1 , Expression`1 >)->Decimal", SequenceMethod.AverageDecimalSelector); map.Add(@"Average(IQueryable`1 , Expression`1 >>)->Nullable`1 ", SequenceMethod.AverageNullableDecimalSelector); map.Add(@"Aggregate(IQueryable`1 , Expression`1 >)->T0", SequenceMethod.Aggregate); map.Add(@"Aggregate(IQueryable`1 , T1, Expression`1 >)->T1", SequenceMethod.AggregateSeed); map.Add(@"Aggregate(IQueryable`1 , T1, Expression`1 >, Expression`1 >)->T2", SequenceMethod.AggregateSeedSelector); map.Add(@"AsQueryable(IEnumerable`1 )->IQueryable`1 ", SequenceMethod.AsQueryableGeneric); map.Add(@"Where(IQueryable`1 , Expression`1 >)->IQueryable`1 ", SequenceMethod.Where); map.Add(@"Where(IQueryable`1 , Expression`1 >)->IQueryable`1 ", SequenceMethod.WhereOrdinal); map.Add(@"OfType(IQueryable)->IQueryable`1 ", SequenceMethod.OfType); map.Add(@"Cast(IQueryable)->IQueryable`1 ", SequenceMethod.Cast); map.Add(@"Select(IQueryable`1 , Expression`1 >)->IQueryable`1 ", SequenceMethod.Select); map.Add(@"Select(IQueryable`1 , Expression`1 >)->IQueryable`1 ", SequenceMethod.SelectOrdinal); map.Add(@"SelectMany(IQueryable`1 , Expression`1 >>)->IQueryable`1 ", SequenceMethod.SelectMany); map.Add(@"SelectMany(IQueryable`1 , Expression`1 >>)->IQueryable`1 ", SequenceMethod.SelectManyOrdinal); map.Add(@"SelectMany(IQueryable`1 , Expression`1 >>, Expression`1 >)->IQueryable`1 ", SequenceMethod.SelectManyOrdinalResultSelector); map.Add(@"SelectMany(IQueryable`1 , Expression`1 >>, Expression`1 >)->IQueryable`1 ", SequenceMethod.SelectManyResultSelector); map.Add(@"Join(IQueryable`1 , IEnumerable`1 , Expression`1 >, Expression`1 >, Expression`1 >)->IQueryable`1 ", SequenceMethod.Join); map.Add(@"Join(IQueryable`1 , IEnumerable`1 , Expression`1 >, Expression`1 >, Expression`1 >, IEqualityComparer`1 )->IQueryable`1 ", SequenceMethod.JoinComparer); map.Add(@"GroupJoin(IQueryable`1 , IEnumerable`1 , Expression`1 >, Expression`1 >, Expression`1 , T3>>)->IQueryable`1 ", SequenceMethod.GroupJoin); map.Add(@"GroupJoin(IQueryable`1 , IEnumerable`1 , Expression`1 >, Expression`1 >, Expression`1 , T3>>, IEqualityComparer`1 )->IQueryable`1 ", SequenceMethod.GroupJoinComparer); map.Add(@"OrderBy(IQueryable`1 , Expression`1 >)->IOrderedQueryable`1 ", SequenceMethod.OrderBy); map.Add(@"OrderBy(IQueryable`1 , Expression`1 >, IComparer`1 )->IOrderedQueryable`1 ", SequenceMethod.OrderByComparer); map.Add(@"OrderByDescending(IQueryable`1 , Expression`1 >)->IOrderedQueryable`1 ", SequenceMethod.OrderByDescending); map.Add(@"OrderByDescending(IQueryable`1 , Expression`1 >, IComparer`1 )->IOrderedQueryable`1 ", SequenceMethod.OrderByDescendingComparer); map.Add(@"ThenBy(IOrderedQueryable`1 , Expression`1 >)->IOrderedQueryable`1 ", SequenceMethod.ThenBy); map.Add(@"ThenBy(IOrderedQueryable`1 , Expression`1 >, IComparer`1 )->IOrderedQueryable`1 ", SequenceMethod.ThenByComparer); map.Add(@"ThenByDescending(IOrderedQueryable`1 , Expression`1 >)->IOrderedQueryable`1 ", SequenceMethod.ThenByDescending); map.Add(@"ThenByDescending(IOrderedQueryable`1 , Expression`1 >, IComparer`1 )->IOrderedQueryable`1 ", SequenceMethod.ThenByDescendingComparer); map.Add(@"Take(IQueryable`1 , Int32)->IQueryable`1 ", SequenceMethod.Take); map.Add(@"TakeWhile(IQueryable`1 , Expression`1 >)->IQueryable`1 ", SequenceMethod.TakeWhile); map.Add(@"TakeWhile(IQueryable`1 , Expression`1 >)->IQueryable`1 ", SequenceMethod.TakeWhileOrdinal); map.Add(@"Skip(IQueryable`1 , Int32)->IQueryable`1 ", SequenceMethod.Skip); map.Add(@"SkipWhile(IQueryable`1 , Expression`1 >)->IQueryable`1 ", SequenceMethod.SkipWhile); map.Add(@"SkipWhile(IQueryable`1 , Expression`1 >)->IQueryable`1 ", SequenceMethod.SkipWhileOrdinal); map.Add(@"GroupBy(IQueryable`1 , Expression`1 >)->IQueryable`1 >", SequenceMethod.GroupBy); map.Add(@"GroupBy(IQueryable`1 , Expression`1 >, Expression`1 >)->IQueryable`1 >", SequenceMethod.GroupByElementSelector); map.Add(@"GroupBy(IQueryable`1 , Expression`1 >, IEqualityComparer`1 )->IQueryable`1 >", SequenceMethod.GroupByComparer); map.Add(@"GroupBy(IQueryable`1 , Expression`1 >, Expression`1 >, IEqualityComparer`1 )->IQueryable`1 >", SequenceMethod.GroupByElementSelectorComparer); map.Add(@"GroupBy(IQueryable`1 , Expression`1 >, Expression`1 >, Expression`1 , T3>>)->IQueryable`1 ", SequenceMethod.GroupByElementSelectorResultSelector); map.Add(@"GroupBy(IQueryable`1 , Expression`1 >, Expression`1 , T2>>)->IQueryable`1 ", SequenceMethod.GroupByResultSelector); map.Add(@"GroupBy(IQueryable`1 , Expression`1 >, Expression`1 , T2>>, IEqualityComparer`1 )->IQueryable`1 ", SequenceMethod.GroupByResultSelectorComparer); map.Add(@"GroupBy(IQueryable`1 , Expression`1 >, Expression`1 >, Expression`1 , T3>>, IEqualityComparer`1 )->IQueryable`1 ", SequenceMethod.GroupByElementSelectorResultSelectorComparer); map.Add(@"Distinct(IQueryable`1 )->IQueryable`1 ", SequenceMethod.Distinct); map.Add(@"Distinct(IQueryable`1 , IEqualityComparer`1 )->IQueryable`1 ", SequenceMethod.DistinctComparer); map.Add(@"Concat(IQueryable`1 , IEnumerable`1 )->IQueryable`1 ", SequenceMethod.Concat); map.Add(@"Union(IQueryable`1 , IEnumerable`1 )->IQueryable`1 ", SequenceMethod.Union); map.Add(@"Union(IQueryable`1 , IEnumerable`1 , IEqualityComparer`1 )->IQueryable`1 ", SequenceMethod.UnionComparer); map.Add(@"Intersect(IQueryable`1 , IEnumerable`1 )->IQueryable`1 ", SequenceMethod.Intersect); map.Add(@"Intersect(IQueryable`1 , IEnumerable`1 , IEqualityComparer`1 )->IQueryable`1 ", SequenceMethod.IntersectComparer); map.Add(@"Except(IQueryable`1 , IEnumerable`1 )->IQueryable`1 ", SequenceMethod.Except); map.Add(@"Except(IQueryable`1 , IEnumerable`1 , IEqualityComparer`1 )->IQueryable`1 ", SequenceMethod.ExceptComparer); map.Add(@"First(IQueryable`1 )->T0", SequenceMethod.First); map.Add(@"First(IQueryable`1 , Expression`1 >)->T0", SequenceMethod.FirstPredicate); map.Add(@"FirstOrDefault(IQueryable`1 )->T0", SequenceMethod.FirstOrDefault); map.Add(@"FirstOrDefault(IQueryable`1 , Expression`1 >)->T0", SequenceMethod.FirstOrDefaultPredicate); map.Add(@"Last(IQueryable`1 )->T0", SequenceMethod.Last); map.Add(@"Last(IQueryable`1 , Expression`1 >)->T0", SequenceMethod.LastPredicate); map.Add(@"LastOrDefault(IQueryable`1 )->T0", SequenceMethod.LastOrDefault); map.Add(@"LastOrDefault(IQueryable`1 , Expression`1 >)->T0", SequenceMethod.LastOrDefaultPredicate); map.Add(@"Single(IQueryable`1 )->T0", SequenceMethod.Single); map.Add(@"Single(IQueryable`1 , Expression`1 >)->T0", SequenceMethod.SinglePredicate); map.Add(@"SingleOrDefault(IQueryable`1 )->T0", SequenceMethod.SingleOrDefault); map.Add(@"SingleOrDefault(IQueryable`1 , Expression`1 >)->T0", SequenceMethod.SingleOrDefaultPredicate); map.Add(@"ElementAt(IQueryable`1 , Int32)->T0", SequenceMethod.ElementAt); map.Add(@"ElementAtOrDefault(IQueryable`1 , Int32)->T0", SequenceMethod.ElementAtOrDefault); map.Add(@"DefaultIfEmpty(IQueryable`1 )->IQueryable`1 ", SequenceMethod.DefaultIfEmpty); map.Add(@"DefaultIfEmpty(IQueryable`1 , T0)->IQueryable`1 ", SequenceMethod.DefaultIfEmptyValue); map.Add(@"Contains(IQueryable`1 , T0)->Boolean", SequenceMethod.Contains); map.Add(@"Contains(IQueryable`1 , T0, IEqualityComparer`1 )->Boolean", SequenceMethod.ContainsComparer); map.Add(@"Reverse(IQueryable`1 )->IQueryable`1 ", SequenceMethod.Reverse); map.Add(@"SequenceEqual(IQueryable`1 , IEnumerable`1 )->Boolean", SequenceMethod.SequenceEqual); map.Add(@"SequenceEqual(IQueryable`1 , IEnumerable`1 , IEqualityComparer`1 )->Boolean", SequenceMethod.SequenceEqualComparer); map.Add(@"Any(IQueryable`1 )->Boolean", SequenceMethod.Any); map.Add(@"Any(IQueryable`1 , Expression`1 >)->Boolean", SequenceMethod.AnyPredicate); map.Add(@"All(IQueryable`1 , Expression`1