get class from type c# code example
Example 1: get type of variable c#
string a = "This is a string";
Console.WriteLine(a.GetType())
Example 2: c# get class name by type
typeof(T).Name // class name, no namespace
typeof(T).FullName // namespace and class name
typeof(T).Namespace // namespace, no class name
Example 3: c# get type of class
Type tp = value.GetType();