Runtime Type Identification (RTTI)
§Query metadata at runtime using types defined in System.Reflection namespace
§Query type information
§Heart of Reflection is provided by System.Type class
Get the type using -  Object.GetType
§if (ent.GetType().Name == "Polyline2d") //C#
§{ }
§
§Dim t As Type = GetType(DBDictionary) ‘VB
§System.Type t = typeof(DBDictionary); //C#
§
The .NET API through the System.Reflection namespace allows you to query the metadata in a .NET module at runtime. It will also allow you to query type information for an object. The System.Type class is fundamental to Runtime Type Identification. You use the GetType method of the object to get the type. In this C# example GetType and the Name property is used to find out if the entity is a Polyline2d. In VB there is also a GetType function and the equivalent in C# is the typeof operator. You will use these functions to ensure your code is working on the right type of entity.