MetaInterface
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 MetaInterface class represents an interface in the Telerik Data Access metadata model. The MetaInterface class derives from MetaType. During runtime, you could access all interfaces that are available in the current container instance via the Interfaces collection property of the MetadataContainer. The MetaInterface class exposes a collection named Implementations, which represents all MetaType objects that implement this interface.
The following examples shows you how to get information about the interfaces in your domain model:
private string GetInterfaces(Telerik.OpenAccess.Metadata.MetadataContainer container)
{
StringBuilder sb = new StringBuilder();
foreach (MetaInterface metaInterface in container.Interfaces)
{
sb.AppendFormat("\nInterfaceName: {0}", metaInterface.Name);
sb.AppendFormat("\nImplementationsCount: {0}", metaInterface.Implementations.Count);
}
return sb.ToString();
}
Private Function GetInterfaces(ByVal container As Telerik.OpenAccess.Metadata.MetadataContainer) As String
Dim sb As New StringBuilder()
For Each _metaInterface As MetaInterface In container.Interfaces
sb.AppendFormat(vbLf & "InterfaceName: {0}", _metaInterface.Name)
sb.AppendFormat(vbLf & "ImplementationsCount: {0}", _metaInterface.Implementations.Count)
Next _metaInterface
Return sb.ToString()
End Function
The following example shows a sample XML representation of a MetaInterface element with two members:
<orm:interface name="IDepartment" uniqueId="70a368b6-3972-4a60-ae6a-5e4488ff99bd">
<orm:field name="_departmentID" property="DepartmentID"
uniqueId="4cb38c32-8f4e-46ae-aaee-60485a39fc20" type="System.Int32" />
<orm:field name="_groupName" property="GroupName"
uniqueId="d95d3b94-7a96-4a74-b1a5-5d81b6e2ddcc" type="System.String" />
</orm:interface>