Skip to content

Commit

Permalink
Add [DynamicDependency] on DateOnly/TimeOnly for trimming
Browse files Browse the repository at this point in the history
Allows SQLite to be used when trimming.

Fixes dotnet#27311
  • Loading branch information
roji committed Apr 28, 2022
1 parent 5e49b24 commit 766cc39
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/EFCore.Relational/Query/IMethodCallTranslator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public interface IMethodCallTranslator
// 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))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(DateOnly))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(TimeOnly))]
SqlExpression? Translate(
SqlExpression? instance,
MethodInfo method,
Expand Down

0 comments on commit 766cc39

Please sign in to comment.