File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
// See the LICENSE file in the project root for more information.
4
4
5
+ #if NET6_0_OR_GREATER
6
+ using System . Diagnostics . CodeAnalysis ;
7
+ #endif
5
8
using System . Reflection ;
6
9
using System . Runtime . CompilerServices ;
7
10
using System . Threading . Tasks ;
@@ -24,7 +27,11 @@ public static class TaskExtensions
24
27
/// a value type, which adds overhead. It should only be used when using generics is not possible.
25
28
/// </remarks>
26
29
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
27
- public static object ? GetResultOrDefault ( this Task task )
30
+ public static object ? GetResultOrDefault (
31
+ #if NET6_0_OR_GREATER
32
+ [ DynamicallyAccessedMembers ( DynamicallyAccessedMemberTypes . PublicProperties ) ]
33
+ #endif
34
+ this Task task )
28
35
{
29
36
// Check if the instance is a completed Task
30
37
if (
Original file line number Diff line number Diff line change @@ -802,6 +802,7 @@ private void ClearErrorsForProperty(string propertyName)
802
802
/// </summary>
803
803
/// <param name="propertyName">The target property name being validated.</param>
804
804
/// <returns>The display name for the property.</returns>
805
+ [ RequiresUnreferencedCode ( "The type of the current instance cannot be statically discovered." ) ]
805
806
private string GetDisplayNameForProperty ( string propertyName )
806
807
{
807
808
static Dictionary < string , string > GetDisplayNames ( Type type )
You can’t perform that action at this time.
0 commit comments