Skip to content

Commit 3232d6d

Browse files
committed
Fix net461 build
1 parent d9ac28d commit 3232d6d

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/NHibernate/Linq/Functions/StringGenerator.cs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,21 +260,27 @@ public override HqlTreeNode BuildHql(MethodInfo method, Expression targetObject,
260260

261261
public class ReplaceGenerator : BaseHqlGeneratorForMethod
262262
{
263+
#if NETCOREAPP2_0
263264
private static readonly MethodInfo MethodWithComparer = ReflectHelper.GetMethodDefinition<string>(x => x.Replace(string.Empty, string.Empty, default(StringComparison)));
265+
#endif
264266

265267
public ReplaceGenerator()
266268
{
267269
SupportedMethods = new[]
268-
{
269-
ReflectHelper.GetMethodDefinition<string>(s => s.Replace(' ', ' ')),
270-
ReflectHelper.GetMethodDefinition<string>(s => s.Replace("", "")),
271-
MethodWithComparer,
272-
};
270+
{
271+
ReflectHelper.GetMethodDefinition<string>(s => s.Replace(' ', ' ')),
272+
ReflectHelper.GetMethodDefinition<string>(s => s.Replace("", "")),
273+
#if NETCOREAPP2_0
274+
MethodWithComparer,
275+
#endif
276+
};
273277
}
274278

275279
public override HqlTreeNode BuildHql(MethodInfo method, Expression targetObject, ReadOnlyCollection<Expression> arguments, HqlTreeBuilder treeBuilder, IHqlExpressionVisitor visitor)
276280
{
281+
#if NETCOREAPP2_0
277282
LogIgnoredStringComparisonParameter(method, MethodWithComparer);
283+
#endif
278284
return treeBuilder.MethodCall(
279285
"replace",
280286
visitor.Visit(targetObject).AsExpression(),

0 commit comments

Comments
 (0)