示例#1
0
 /// <summary>
 /// Performs initialization for the given generic type argument.
 /// </summary>
 /// <remarks>
 /// This method is present for the sake of AOT compilers. It allows code (whether handwritten or generated)
 /// to make calls into the reflection machinery of this library to express an intention to use that type
 /// reflectively (e.g. for JSON parsing and formatting). The call itself does almost nothing, but AOT compilers
 /// attempting to determine which generic type arguments need to be handled will spot the code path and act
 /// accordingly.
 /// </remarks>
 /// <typeparam name="T">The type to force initialization for.</typeparam>
 public static void ForceReflectionInitialization <T>() => ReflectionUtil.ForceInitialize <T>();