Skip to content

Commit

Permalink
fix: fix #3497. make internalsdkutils trim compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
peterrsongg committed Oct 10, 2024
1 parent bcd8eb9 commit a73fca4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"core": {
"changeLogMessages": [
"Fix #3497, make InternalSDKUtils aot compatible."
],
"type": "patch",
"updateMinimum": true
}
}
10 changes: 7 additions & 3 deletions sdk/src/Core/Amazon.Util/Internal/InternalSDKUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using Amazon.Runtime.Internal.Util;
using Amazon.Util.Internal.PlatformServices;
using System.Text;
using System.Diagnostics.CodeAnalysis;

namespace Amazon.Util.Internal
{
Expand Down Expand Up @@ -142,13 +143,16 @@ public static string BuildUserAgentString(string serviceId, string serviceSdkVer
}

#endregion

public static void ApplyValues(object target, IDictionary<string, object> propertyValues)
#if NET8_0_OR_GREATER
public static void ApplyValues<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] T>(T target, IDictionary<string, object> propertyValues)
#else
public static void ApplyValues<T>(T target, IDictionary<string, object> propertyValues)
#endif
{
if (propertyValues == null || propertyValues.Count == 0)
return;

var targetType = target.GetType();
var targetType = typeof(T);

foreach(var kvp in propertyValues)
{
Expand Down

0 comments on commit a73fca4

Please sign in to comment.