Skip to content

Commit 8cc626c

Browse files
committed
Small corrections
1 parent 7134a38 commit 8cc626c

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

src/NHibernate.Test/Linq/TryGetMappedTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ namespace NHibernate.Test.Linq
2323
/// </summary>
2424
public class TryGetMappedTests : LinqTestCase
2525
{
26-
private readonly static TryGetMappedType _tryGetMappedType;
27-
private readonly static TryGetMappedNullability _tryGetMappedNullability;
26+
private static readonly TryGetMappedType _tryGetMappedType;
27+
private static readonly TryGetMappedNullability _tryGetMappedNullability;
2828

2929
delegate bool TryGetMappedType(
3030
ISessionFactoryImplementor sessionFactory,

src/NHibernate/Util/ExpressionsHelper.cs

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,8 @@ internal static bool TryGetMappedType(
165165
component = null;
166166
return false;
167167
}
168-
else
169-
{
170-
currentEntityPersister = convertPersister; // ((Subclass)q).Id
171-
}
168+
169+
currentEntityPersister = convertPersister; // ((Subclass)q).Id
172170
}
173171

174172
return TraverseMembers(
@@ -222,16 +220,13 @@ private static bool TraverseMembers(
222220
}
223221
else
224222
{
225-
if (!currentType.IsAnyType)
226-
{
227-
// Concatenate the component property path in order to be able to use EntityMetamodel.GetPropertyType to retrieve the type.
228-
// As GetPropertyType supports only components, do not concatenate when dealing with collection composite elements or elements.
229-
// q.Component.Prop
230-
member = new MemberMetadata(
231-
$"{memberPath}.{member.Path}",
232-
member.ConvertType,
233-
member.HasIndexer);
234-
}
223+
// Concatenate the component property path in order to be able to use EntityMetamodel.GetPropertyType to retrieve the type.
224+
// As GetPropertyType supports only components, do not concatenate when dealing with collection composite elements or elements.
225+
// q.Component.Prop
226+
member = new MemberMetadata(
227+
$"{memberPath}.{member.Path}",
228+
member.ConvertType,
229+
member.HasIndexer);
235230

236231
// q.Component.Prop
237232
currentType = currentEntityPersister.EntityMetamodel.GetPropertyType(member.Path);
@@ -475,7 +470,7 @@ private class MemberMetadataExtractor : NhExpressionVisitor
475470
/// <summary>
476471
/// Traverses the expression from top to bottom until the first <see cref="ConstantExpression"/> containing an IEntityNameProvider instance is found.
477472
/// </summary>
478-
/// <param name="expression">The expression to travese.</param>
473+
/// <param name="expression">The expression to traverse.</param>
479474
/// <param name="entityName">An output parameter that will be populated by the first <see cref="IEntityNameProvider.EntityName"/> that is found or null otherwise.</param>
480475
/// <param name="convertType">An output parameter that will be populated only when <see cref="ConstantExpression"/> containing an IEntityNameProvider
481476
/// is followed by an <see cref="UnaryExpression"/>.</param>

0 commit comments

Comments
 (0)