You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -29,6 +30,8 @@ public static class NpgsqlServiceCollectionExtensions
29
30
/// Defaults to <see cref="ServiceLifetime.Singleton" />.
30
31
/// </param>
31
32
/// <returns>The same service collection so that multiple calls can be chained.</returns>
33
+
[RequiresUnreferencedCode("NpgsqlDataSource uses reflection to handle various PostgreSQL types like records, unmapped enums etc. Use NpgsqlSlimDataSourceBuilder to start with a reduced - reflection free - set and opt into what your app specifically requires.")]
34
+
[RequiresDynamicCode("NpgsqlDataSource uses reflection to handle various PostgreSQL types like records, unmapped enums. This can require creating new generic types or methods, which requires creating code at runtime. This may not work when AOT compiling.")]
@@ -51,6 +54,8 @@ public static IServiceCollection AddNpgsqlDataSource(
51
54
/// Defaults to <see cref="ServiceLifetime.Singleton" />.
52
55
/// </param>
53
56
/// <returns>The same service collection so that multiple calls can be chained.</returns>
57
+
[RequiresUnreferencedCode("NpgsqlDataSource uses reflection to handle various PostgreSQL types like records, unmapped enums etc. Use NpgsqlSlimDataSourceBuilder to start with a reduced - reflection free - set and opt into what your app specifically requires.")]
58
+
[RequiresDynamicCode("NpgsqlDataSource uses reflection to handle various PostgreSQL types like records, unmapped enums. This can require creating new generic types or methods, which requires creating code at runtime. This may not work when AOT compiling.")]
@@ -76,6 +81,8 @@ public static IServiceCollection AddNpgsqlDataSource(
76
81
/// Defaults to <see cref="ServiceLifetime.Singleton" />.
77
82
/// </param>
78
83
/// <returns>The same service collection so that multiple calls can be chained.</returns>
84
+
[RequiresUnreferencedCode("NpgsqlDataSource uses reflection to handle various PostgreSQL types like records, unmapped enums etc. Use NpgsqlSlimDataSourceBuilder to start with a reduced - reflection free - set and opt into what your app specifically requires.")]
85
+
[RequiresDynamicCode("NpgsqlDataSource uses reflection to handle various PostgreSQL types like records, unmapped enums. This can require creating new generic types or methods, which requires creating code at runtime. This may not work when AOT compiling.")]
@@ -100,6 +107,8 @@ public static IServiceCollection AddMultiHostNpgsqlDataSource(
100
107
/// Defaults to <see cref="ServiceLifetime.Singleton" />.
101
108
/// </param>
102
109
/// <returns>The same service collection so that multiple calls can be chained.</returns>
110
+
[RequiresUnreferencedCode("NpgsqlDataSource uses reflection to handle various PostgreSQL types like records, unmapped enums etc. Use NpgsqlSlimDataSourceBuilder to start with a reduced - reflection free - set and opt into what your app specifically requires.")]
111
+
[RequiresDynamicCode("NpgsqlDataSource uses reflection to handle various PostgreSQL types like records, unmapped enums. This can require creating new generic types or methods, which requires creating code at runtime. This may not work when AOT compiling.")]
[RequiresUnreferencedCode("NpgsqlDataSource uses reflection to handle various PostgreSQL types like records, unmapped enums etc. Use NpgsqlSlimDataSourceBuilder to start with a reduced - reflection free - set and opt into what your app specifically requires.")]
121
+
[RequiresDynamicCode("NpgsqlDataSource uses reflection to handle various PostgreSQL types like records, unmapped enums. This can require creating new generic types or methods, which requires creating code at runtime. This may not work when AOT compiling.")]
[RequiresUnreferencedCode("NpgsqlDataSource uses reflection to handle various PostgreSQL types like records, unmapped enums etc. Use NpgsqlSlimDataSourceBuilder to start with a reduced - reflection free - set and opt into what your app specifically requires.")]
147
+
[RequiresDynamicCode("NpgsqlDataSource uses reflection to handle various PostgreSQL types like records, unmapped enums. This can require creating new generic types or methods, which requires creating code at runtime. This may not work when AOT compiling.")]
Copy file name to clipboardExpand all lines: src/Npgsql.Json.NET/NpgsqlJsonNetExtensions.cs
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
usingSystem;
2
+
usingSystem.Diagnostics.CodeAnalysis;
2
3
usingNpgsql.TypeMapping;
3
4
usingNpgsqlTypes;
4
5
usingNewtonsoft.Json;
@@ -23,6 +24,8 @@ public static class NpgsqlJsonNetExtensions
23
24
/// <param name="jsonClrTypes">
24
25
/// A list of CLR types to map to PostgreSQL <c>json</c> (no need to specify <see cref="NpgsqlDbType.Json" />).
25
26
/// </param>
27
+
[RequiresUnreferencedCode("Json serializer may perform reflection on trimmed types.")]
28
+
[RequiresDynamicCode("Serializing arbitary types to json can require creating new generic types or methods, which requires creating code at runtime. This may not work when AOT compiling.")]
[RequiresDynamicCode("Changing boxing converters to their non-boxing counterpart can require creating new generic types or methods, which requires creating code at runtime. This may not be AOT when AOT compiling")]
}, mapping =>mappingwith{MatchRequirement=MatchRequirement.Single,TypeMatchPredicate= type =>typeisnull||typeof(IPAddress).IsAssignableFrom(type)});
42
+
CreateInfo, mapping =>mappingwith{MatchRequirement=MatchRequirement.Single,TypeMatchPredicate= type =>typeisnull||typeof(IPAddress).IsAssignableFrom(type)});
0 commit comments