File tree 2 files changed +5
-6
lines changed
src/DataProtection/EntityFrameworkCore/src
2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 1
1
// Licensed to the .NET Foundation under one or more agreements.
2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
4
- using System . Diagnostics . CodeAnalysis ;
5
-
6
4
namespace Microsoft . AspNetCore . DataProtection . EntityFrameworkCore ;
7
5
8
6
/// <summary>
9
7
/// Code first model used by <see cref="EntityFrameworkCoreXmlRepository{TContext}"/>.
10
8
/// </summary>
11
- // DataProtectionKey.Id is not used anywhere. Add DynamicallyAccessedMembers to prevent it from being trimmed.
12
- // Note that in the future EF may annotate itself to include properties automatically, and the annotation here could be removed.
13
- // Fixes https://github.com/dotnet/aspnetcore/issues/43187
14
- [ DynamicallyAccessedMembers ( DynamicallyAccessedMemberTypes . PublicProperties ) ]
15
9
public class DataProtectionKey
16
10
{
17
11
/// <summary>
Original file line number Diff line number Diff line change 1
1
// Licensed to the .NET Foundation under one or more agreements.
2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
4
+ using System . Diagnostics . CodeAnalysis ;
4
5
using System . Linq ;
5
6
using System . Xml . Linq ;
6
7
using Microsoft . AspNetCore . DataProtection . Repositories ;
@@ -24,6 +25,10 @@ public class EntityFrameworkCoreXmlRepository<TContext> : IXmlRepository
24
25
/// </summary>
25
26
/// <param name="services"></param>
26
27
/// <param name="loggerFactory">The <see cref="ILoggerFactory"/>.</param>
28
+ // DataProtectionKey.Id is not used anywhere. Add DynamicDependency to prevent it from being trimmed.
29
+ // Note that in the future EF may annotate itself to include properties automatically, and the annotation here could be removed.
30
+ // Fixes https://github.com/dotnet/aspnetcore/issues/43187
31
+ [ DynamicDependency ( DynamicallyAccessedMemberTypes . PublicProperties , typeof ( DataProtectionKey ) ) ]
27
32
public EntityFrameworkCoreXmlRepository ( IServiceProvider services , ILoggerFactory loggerFactory )
28
33
{
29
34
if ( loggerFactory == null )
You can’t perform that action at this time.
0 commit comments