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 22// The .NET Foundation licenses this file to you under the MIT license.
33// See the LICENSE file in the project root for more information.
44
5+ #if NET6_0_OR_GREATER
6+ using System . Diagnostics . CodeAnalysis ;
7+ #endif
58using System . Reflection ;
69using System . Runtime . CompilerServices ;
710using System . Threading . Tasks ;
@@ -24,7 +27,11 @@ public static class TaskExtensions
2427 /// a value type, which adds overhead. It should only be used when using generics is not possible.
2528 /// </remarks>
2629 [ 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 )
2835 {
2936 // Check if the instance is a completed Task
3037 if (
Original file line number Diff line number Diff line change @@ -802,6 +802,7 @@ private void ClearErrorsForProperty(string propertyName)
802802 /// </summary>
803803 /// <param name="propertyName">The target property name being validated.</param>
804804 /// <returns>The display name for the property.</returns>
805+ [ RequiresUnreferencedCode ( "The type of the current instance cannot be statically discovered." ) ]
805806 private string GetDisplayNameForProperty ( string propertyName )
806807 {
807808 static Dictionary < string , string > GetDisplayNames ( Type type )
You can’t perform that action at this time.
0 commit comments