|
1 | 1 | using System;
|
2 |
| -using System.Collections; |
3 | 2 | using System.Collections.Generic;
|
4 |
| -using System.Linq; |
5 | 3 | using System.Linq.Expressions;
|
6 |
| -using System.Reflection; |
7 | 4 | using NHibernate.Linq.ExpressionTransformers;
|
8 | 5 | using NHibernate.Linq.Visitors;
|
9 |
| -using NHibernate.Util; |
10 | 6 | using Remotion.Linq;
|
11 |
| -using Remotion.Linq.EagerFetching.Parsing; |
12 | 7 | using Remotion.Linq.Parsing.ExpressionVisitors.Transformation;
|
13 | 8 | using Remotion.Linq.Parsing.Structure;
|
14 | 9 | using Remotion.Linq.Parsing.Structure.ExpressionTreeProcessors;
|
15 |
| -using Remotion.Linq.Parsing.Structure.NodeTypeProviders; |
16 | 10 |
|
17 | 11 | namespace NHibernate.Linq
|
18 | 12 | {
|
@@ -91,55 +85,4 @@ internal static Func<Expression, Expression> CreatePreTransformer(IExpressionTra
|
91 | 85 | return new TransformingExpressionTreeProcessor(preTransformerRegistry).Process;
|
92 | 86 | }
|
93 | 87 | }
|
94 |
| - |
95 |
| - public class NHibernateNodeTypeProvider : INodeTypeProvider |
96 |
| - { |
97 |
| - private INodeTypeProvider defaultNodeTypeProvider; |
98 |
| - |
99 |
| - public NHibernateNodeTypeProvider() |
100 |
| - { |
101 |
| - var methodInfoRegistry = new MethodInfoBasedNodeTypeRegistry(); |
102 |
| - |
103 |
| - methodInfoRegistry.Register( |
104 |
| - new[] { ReflectHelper.FastGetMethodDefinition(EagerFetchingExtensionMethods.Fetch, default(IQueryable<object>), default(Expression<Func<object, object>>)) }, |
105 |
| - typeof(FetchOneExpressionNode)); |
106 |
| - methodInfoRegistry.Register( |
107 |
| - new[] { ReflectHelper.FastGetMethodDefinition(EagerFetchingExtensionMethods.FetchLazyProperties, default(IQueryable<object>)) }, |
108 |
| - typeof(FetchLazyPropertiesExpressionNode)); |
109 |
| - methodInfoRegistry.Register( |
110 |
| - new[] { ReflectHelper.FastGetMethodDefinition(EagerFetchingExtensionMethods.FetchMany, default(IQueryable<object>), default(Expression<Func<object, IEnumerable<object>>>)) }, |
111 |
| - typeof(FetchManyExpressionNode)); |
112 |
| - methodInfoRegistry.Register( |
113 |
| - new[] { ReflectHelper.FastGetMethodDefinition(EagerFetchingExtensionMethods.ThenFetch, default(INhFetchRequest<object, object>), default(Expression<Func<object, object>>)) }, |
114 |
| - typeof(ThenFetchOneExpressionNode)); |
115 |
| - methodInfoRegistry.Register( |
116 |
| - new[] { ReflectHelper.FastGetMethodDefinition(EagerFetchingExtensionMethods.ThenFetchMany, default(INhFetchRequest<object, object>), default(Expression<Func<object, IEnumerable<object>>>)) }, |
117 |
| - typeof(ThenFetchManyExpressionNode)); |
118 |
| - methodInfoRegistry.Register( |
119 |
| - new[] |
120 |
| - { |
121 |
| - ReflectHelper.FastGetMethodDefinition(LinqExtensionMethods.WithLock, default(IQueryable<object>), default(LockMode)), |
122 |
| - ReflectHelper.FastGetMethodDefinition(LinqExtensionMethods.WithLock, default(IEnumerable<object>), default(LockMode)) |
123 |
| - }, |
124 |
| - typeof(LockExpressionNode)); |
125 |
| - |
126 |
| - var nodeTypeProvider = ExpressionTreeParser.CreateDefaultNodeTypeProvider(); |
127 |
| - nodeTypeProvider.InnerProviders.Add(methodInfoRegistry); |
128 |
| - defaultNodeTypeProvider = nodeTypeProvider; |
129 |
| - } |
130 |
| - |
131 |
| - public bool IsRegistered(MethodInfo method) |
132 |
| - { |
133 |
| - // Avoid Relinq turning IDictionary.Contains into ContainsResultOperator. We do our own processing for that method. |
134 |
| - if (method.DeclaringType == typeof(IDictionary) && method.Name == "Contains") |
135 |
| - return false; |
136 |
| - |
137 |
| - return defaultNodeTypeProvider.IsRegistered(method); |
138 |
| - } |
139 |
| - |
140 |
| - public System.Type GetNodeType(MethodInfo method) |
141 |
| - { |
142 |
| - return defaultNodeTypeProvider.GetNodeType(method); |
143 |
| - } |
144 |
| - } |
145 | 88 | }
|
0 commit comments