ListmyList = new List (); Type myListType = myList.GetType(); Type[] genericArgs = myListType.GetGenericArguments();
Type dictionaryType = typeof(Dictionary<,>); Type[] typeParams = dictionaryType.GetGenericArguments();This method is included in the System.Reflection namespace of the .NET Framework, which is a package library for reflection in C#. It allows developers to dynamically explore and access metadata about types and objects at runtime.