Data Access has been discontinued. Please refer to this page for more information.

MetaType

This article is relevant to entity models that utilize the deprecated Visual Studio integration of Telerik Data Access. The current documentation of the Data Access framework is available here.

The MetaType class represents a base class for all types in the Telerik Data Access metadata model. Via the MetaType class you could take access to the following information:

  • Namespace - the CLR namespace of the current type.
  • FullName - constructed by the Namespace and Name properties.
  • TypeAccessModifier - the type access modifier. It could be Public or Assembly (Internal).
  • TypeInheritanceModifier - the type inheritance modifier. It could be Abstract or Final (Sealed).
  • Interfaces - returns a collection of MetaInterface objects representing all interfaces implemented by the current type.
  • Members - returns a collection of MetaMember objects representing all primitive and navigation members of the current type.

The following example shows you how to get information about the access and inheritance modifiers of the persistent types from your domain model:

private string GetModifiers(Telerik.OpenAccess.Metadata.MetadataContainer container)
{
   StringBuilder sb = new StringBuilder();
   foreach (MetaPersistentType persistentType in container.PersistentTypes)
   {
       sb.AppendFormat("\nTypeName: {0}", persistentType.Name);
       sb.AppendFormat("\nAccessModifier: {0}", persistentType.TypeAccessModifier);
       sb.AppendFormat("\nInheritanceModifier: {0}", persistentType.TypeInheritanceModifier);
   }
   return sb.ToString();
}
Private Function GetModifiers(ByVal container As Telerik.OpenAccess.Metadata.MetadataContainer) As String
 Dim sb As New StringBuilder()
 For Each persistentType As MetaPersistentType In container.PersistentTypes
  sb.AppendFormat(vbLf & "TypeName: {0}", persistentType.Name)
  sb.AppendFormat(vbLf & "AccessModifier: {0}", persistentType.TypeAccessModifier)
  sb.AppendFormat(vbLf & "InheritanceModifier: {0}", persistentType.TypeInheritanceModifier)
 Next persistentType
 Return sb.ToString()
End Function