Skip to content

Commit

Permalink
Add [DynamicDependency] on System.Math for trimming (#27098)
Browse files Browse the repository at this point in the history
Fixes #27097
  • Loading branch information
roji authored Jan 6, 2022
1 parent 241c4ee commit 13bb9b0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/EFCore.Relational/Query/IMethodCallTranslator.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;
using System.Reflection;
using Microsoft.EntityFrameworkCore.Diagnostics;
Expand All @@ -28,6 +30,9 @@ public interface IMethodCallTranslator
/// <param name="arguments">SQL representations of <see cref="MethodCallExpression.Arguments" />.</param>
/// <param name="logger">The query logger to use.</param>
/// <returns>A SQL translation of the <see cref="MethodCallExpression" />.</returns>
// This is a 6.0.x hack to make trimming work, since the linker doesn't see our GetRequiredRuntimeMethod invocations below
// (see #26288)
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(Math))]
SqlExpression? Translate(
SqlExpression? instance,
MethodInfo method,
Expand Down

0 comments on commit 13bb9b0

Please sign in to comment.