MCPcopy Create free account
hub / github.com/apache/fory / ResolveRuntimeType

Method ResolveRuntimeType

csharp/src/Fory/AnySerializer.cs:164–175  ·  view source on GitHub ↗
(object value)

Source from the content-addressed store, hash-verified

162 }
163
164 internal static Type ResolveRuntimeType(object value)
165 {
166 Type runtimeType = value.GetType();
167 Type? baseType = runtimeType.BaseType;
168 if (baseType is not null &&
169 Attribute.IsDefined(baseType, typeof(ForyUnionAttribute), inherit: false))
170 {
171 return baseType;
172 }
173
174 return runtimeType;
175 }
176
177 public static object? CastAnyDynamicValue(object? value, Type targetType)
178 {

Callers 1

AnyValueIsRefTypeMethod · 0.80

Calls 1

GetTypeMethod · 0.65

Tested by

no test coverage detected