Skip to content

Commit e2c8ec1

Browse files
committed
Minor (renaming)
SVN: trunk@5066
1 parent a7f49b1 commit e2c8ec1

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

src/NHibernate/Linq/Functions/BaseHqlGeneratorForType.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ public void Register(FunctionRegistry functionRegistry)
1616
{
1717
foreach (var method in generator.SupportedMethods)
1818
{
19-
functionRegistry.RegisterMethodGenerator(method, generator);
19+
functionRegistry.RegisterGenerator(method, generator);
2020
}
2121
}
2222

2323
foreach (var generator in PropertyRegistry)
2424
{
2525
foreach (var property in generator.SupportedProperties)
2626
{
27-
functionRegistry.RegisterPropertyGenerator(property, generator);
27+
functionRegistry.RegisterGenerator(property, generator);
2828
}
2929
}
3030
}

src/NHibernate/Linq/Functions/FunctionRegistry.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ public class FunctionRegistry
1313
{
1414
public static readonly FunctionRegistry Instance = new FunctionRegistry();
1515

16-
private readonly Dictionary<MethodInfo, IHqlGeneratorForMethod> _registeredMethods = new Dictionary<MethodInfo, IHqlGeneratorForMethod>();
17-
private readonly Dictionary<MemberInfo, IHqlGeneratorForProperty> _registeredProperties = new Dictionary<MemberInfo, IHqlGeneratorForProperty>();
18-
private readonly List<IHqlGeneratorForType> _typeGenerators = new List<IHqlGeneratorForType>();
16+
private readonly Dictionary<MethodInfo, IHqlGeneratorForMethod> registeredMethods = new Dictionary<MethodInfo, IHqlGeneratorForMethod>();
17+
private readonly Dictionary<MemberInfo, IHqlGeneratorForProperty> registeredProperties = new Dictionary<MemberInfo, IHqlGeneratorForProperty>();
18+
private readonly List<IHqlGeneratorForType> typeGenerators = new List<IHqlGeneratorForType>();
1919

2020
private FunctionRegistry()
2121
{
@@ -26,7 +26,7 @@ private FunctionRegistry()
2626
Register(new ICollectionGenerator());
2727
}
2828

29-
public IHqlGeneratorForMethod GetMethodGenerator(MethodInfo method)
29+
public IHqlGeneratorForMethod GetGenerator(MethodInfo method)
3030
{
3131
IHqlGeneratorForMethod methodGenerator;
3232

@@ -60,7 +60,7 @@ private bool GetMethodGeneratorForType(MethodInfo method, out IHqlGeneratorForMe
6060
{
6161
methodGenerator = null;
6262

63-
foreach (var typeGenerator in _typeGenerators.Where(typeGenerator => typeGenerator.SupportsMethod(method)))
63+
foreach (var typeGenerator in typeGenerators.Where(typeGenerator => typeGenerator.SupportsMethod(method)))
6464
{
6565
methodGenerator = typeGenerator.GetMethodGenerator(method);
6666
return true;
@@ -85,18 +85,18 @@ private bool GetStandardLinqExtensionMethodGenerator(MethodInfo method, out IHql
8585

8686
private bool GetRegisteredMethodGenerator(MethodInfo method, out IHqlGeneratorForMethod methodGenerator)
8787
{
88-
if (_registeredMethods.TryGetValue(method, out methodGenerator))
88+
if (registeredMethods.TryGetValue(method, out methodGenerator))
8989
{
9090
return true;
9191
}
9292
return false;
9393
}
9494

95-
public IHqlGeneratorForProperty GetPropertyGenerator(MemberInfo member)
95+
public IHqlGeneratorForProperty GetGenerator(MemberInfo member)
9696
{
9797
IHqlGeneratorForProperty propertyGenerator;
9898

99-
if (_registeredProperties.TryGetValue(member, out propertyGenerator))
99+
if (registeredProperties.TryGetValue(member, out propertyGenerator))
100100
{
101101
return propertyGenerator;
102102
}
@@ -105,19 +105,19 @@ public IHqlGeneratorForProperty GetPropertyGenerator(MemberInfo member)
105105
return null;
106106
}
107107

108-
public void RegisterMethodGenerator(MethodInfo method, IHqlGeneratorForMethod generator)
108+
public void RegisterGenerator(MethodInfo method, IHqlGeneratorForMethod generator)
109109
{
110-
_registeredMethods.Add(method, generator);
110+
registeredMethods.Add(method, generator);
111111
}
112112

113-
public void RegisterPropertyGenerator(MemberInfo property, IHqlGeneratorForProperty generator)
113+
public void RegisterGenerator(MemberInfo property, IHqlGeneratorForProperty generator)
114114
{
115-
_registeredProperties.Add(property, generator);
115+
registeredProperties.Add(property, generator);
116116
}
117117

118118
private void Register(IHqlGeneratorForType typeMethodGenerator)
119119
{
120-
_typeGenerators.Add(typeMethodGenerator);
120+
typeGenerators.Add(typeMethodGenerator);
121121
typeMethodGenerator.Register(this);
122122
}
123123
}

src/NHibernate/Linq/Visitors/HqlGeneratorExpressionTreeVisitor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ protected HqlTreeNode VisitMemberExpression(MemberExpression expression)
351351
}
352352

353353
// Look for "special" properties (DateTime.Month etc)
354-
var generator = FunctionRegistry.GetPropertyGenerator(expression.Member);
354+
var generator = FunctionRegistry.GetGenerator(expression.Member);
355355

356356
if (generator != null)
357357
{
@@ -394,7 +394,7 @@ protected HqlTreeNode VisitConstantExpression(ConstantExpression expression)
394394

395395
protected HqlTreeNode VisitMethodCallExpression(MethodCallExpression expression)
396396
{
397-
var generator = FunctionRegistry.GetMethodGenerator(expression.Method);
397+
var generator = FunctionRegistry.GetGenerator(expression.Method);
398398

399399
return generator.BuildHql(expression.Method, expression.Object, expression.Arguments, _hqlTreeBuilder, this);
400400
}

0 commit comments

Comments
 (0)