Skip to content

Commit 6ccf2cd

Browse files
author
CodeStudio Agent
committed
Can you summarize the completion so far and what are pending to do next?
1 parent 212a81f commit 6ccf2cd

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎src/Data/NullableHelper.cs‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
using System.ComponentModel;
1+
using System.ComponentModel;
22
using System.Reflection;
33
using System.Globalization;
44
using System.Collections;
5+
using System.Diagnostics.CodeAnalysis;
56
using Hashtable = System.Collections.Generic.Dictionary<object, object>;
67

78
namespace Syncfusion.Blazor.Toolkit.Data
@@ -68,6 +69,7 @@ public static bool IsIEnumerableType(PropertyInfo pd)
6869
/// <param name="value"></param>
6970
/// <param name="type"></param>
7071
/// <returns></returns>
72+
[RequiresUnreferencedCode("Calls TypeConverterHelper.ChangeType, which calls TypeDescriptor.GetConverter(Type) and is unsafe to trim.")]
7173
public static object ChangeType(object value, Type type)
7274
{
7375
Type? nullableUnderlyingType = Nullable.GetUnderlyingType(type);
@@ -94,6 +96,7 @@ public static object ChangeType(object value, Type type)
9496
/// <param name="type"></param>
9597
/// <param name="provider"></param>
9698
/// <returns></returns>
99+
[RequiresUnreferencedCode("Calls TypeConverterHelper.ChangeType, which calls TypeDescriptor.GetConverter(Type) and is unsafe to trim.")]
97100
public static object ChangeType(object value, Type type, IFormatProvider provider)
98101
{
99102
Type? nullableUnderlyingType = Nullable.GetUnderlyingType(type);
@@ -143,6 +146,7 @@ public static bool IsNullableType(Type nullableType)
143146
/// A <see cref="Type"/> representing <c>Nullable&lt;T&gt;</c> for value types, or the original
144147
/// <paramref name="type"/> if it is already nullable or a reference type.
145148
/// </returns>
149+
[RequiresDynamicCode("Calls Type.MakeGenericType(params Type[]) to build Nullable<T> for value types, which may need to generate new code at runtime.")]
146150
public static Type GetNullableType(Type type)
147151
{
148152
if (type == null)
@@ -212,11 +216,13 @@ public static Type GetUnderlyingType(Type type)
212216
/// <exclude />
213217
private class TypeConverterHelper
214218
{
219+
[RequiresUnreferencedCode("Calls TypeDescriptor.GetConverter(Type), which is unsafe to trim.")]
215220
public static object ChangeType(object value, Type type)
216221
{
217222
return ChangeType(value, type, null!);
218223
}
219224

225+
[RequiresUnreferencedCode("Calls TypeDescriptor.GetConverter(Type), which is unsafe to trim.")]
220226
public static object ChangeType(object value, Type type, IFormatProvider provider)
221227
{
222228
// Fix for defects: 13036, 13024, 12601 & 12716
@@ -249,6 +255,7 @@ public static class ValueConvert
249255
/// <param name="type">The target type.</param>
250256
/// <param name="provider">A <see cref="IFormatProvider"/> used to format or parse the value.</param>
251257
/// <returns>The new value in the target type.</returns>
258+
[RequiresUnreferencedCode("Calls ChangeType(object, Type, IFormatProvider, string, bool), which calls TypeDescriptor.GetConverter(Type) and is unsafe to trim.")]
252259
public static object ChangeType(object value, Type type, IFormatProvider provider)
253260
{
254261
return ChangeType(value, type, provider, false);
@@ -263,6 +270,7 @@ public static object ChangeType(object value, Type type, IFormatProvider provide
263270
/// <param name="returnDbNUllIfNotValid">Indicates whether exceptions should be avoided or catched and return value should be DBNull if
264271
/// it cannot be converted to the target type.</param>
265272
/// <returns>The new value in the target type.</returns>
273+
[RequiresUnreferencedCode("Calls ChangeType(object, Type, IFormatProvider, string, bool), which calls TypeDescriptor.GetConverter(Type) and is unsafe to trim.")]
266274
public static object ChangeType(object value, Type type, IFormatProvider provider, bool returnDbNUllIfNotValid)
267275
{
268276
return ChangeType(value, type, provider, string.Empty, returnDbNUllIfNotValid);
@@ -278,6 +286,7 @@ public static object ChangeType(object value, Type type, IFormatProvider provide
278286
/// <param name="returnDbNUllIfNotValid">Indicates whether exceptions should be avoided or catched and return value should be DBNull if
279287
/// it cannot be converted to the target type.</param>
280288
/// <returns>The new value in the target type.</returns>
289+
[RequiresUnreferencedCode("Calls Parse and NullableHelperInternal.ChangeType, which call TypeDescriptor.GetConverter(Type) and are unsafe to trim.")]
281290
public static object ChangeType(object value, Type type, IFormatProvider provider, string format,
282291
bool returnDbNUllIfNotValid)
283292
{

0 commit comments

Comments
 (0)