1 origin
Lao Zhao is talking about the cache of expression trees (2): It is mentioned in the expression tree generation string that discussing FullName or AssemblyQualifiedName providing complete type information when describing type information is a small topic, but it is a topic worth talking about. The following three properties for reacting to a type name information in. NET are:
Name to get the names of the current members.
FullName, gets the fully qualified name of type, including the namespace of type, but does not include the assembly.
AssemblyQualifiedName, gets the assembly-qualified name of type, including the name of the assembly from which the type is loaded. In fact, AssemblyQualifiedName is defined as a read-only abstract attribute, and the specific implementation is implemented by its derived classes, such as TypeBuilder, which we can have a general idea of by its specific implementation type.
The definition here is undoubtedly official (MSDN), as the saying goes, the truth is the only criterion for testing truth, then these three similar concepts, what is the difference, we return to the facts.
2 Cheong Chat Name
2.1 By the simple start
From the simple start, we might as well look at the facts returned by the three different name of object:
static void Main(string[] args)
{
Type t1 = typeof(object);
Console.WriteLine(t1.Name);
Console.WriteLine(t1.FullName);
Console.WriteLine(t1.AssemblyQualifiedName);
}
What about the execution results?
As MSDN says, name returns a simple type name, FullName contains namespaces, and AssemblyQualifiedName contains assembly full names. For a assemblyqualifiedname assembly, however, the associated assembly information is still returned, for example:
Console.WriteLine(t3.AssemblyQualifiedName);
Anytao.Learning.ExpressionTree.One, Anytao.Learning.ExpressionTree, version=1.0.
0.0, culture=neutral, publickeytoken=null
2.2 to the complex over
If we just look at the simple type, then the three guys are not worth the time to notice, except for simplicity and complexity. So, I took the expression to Sanding in particular:
static void Main(string[] args)
{
Type t2 = typeof(Expression<Func<int, int>>);
Console.WriteLine(t2.Name);
Console.WriteLine(t2.FullName);
Console.WriteLine(t2.AssemblyQualifiedName);
}
What about the results of the execution?