November Happy Hour will be moved to Thursday December 5th.

Class MetaClass

Represents meta class meta information.

Inheritance
System.Object
MetaClass
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Mediachase.BusinessFoundation.Data.Meta.Management
Assembly: Mediachase.BusinessFoundation.Data.dll
Version: 13.30.0
Syntax
public class MetaClass : IChangeTracking
Remarks

The MetaClass class allows to read, modify meta class meta information and creates (removes) meta fields.

Constructors

MetaClass()

Initializes a new instance of the MetaClass class.

Declaration
public MetaClass()

MetaClass(String, String)

Initializes a new instance of the MetaClass class.

Declaration
public MetaClass(string name, string friendlyName)
Parameters
Type Name Description
System.String name

The name.

System.String friendlyName

The friendly name.

Properties

AccessLevel

Gets or sets the access level.

Declaration
public AccessLevel AccessLevel { get; set; }
Property Value
Type Description
AccessLevel

The access level.

Attributes

Gets the attributes.

Declaration
public AttributeCollection Attributes { get; set; }
Property Value
Type Description
AttributeCollection

The attributes.

CardOwner

Gets the card owner.

Declaration
public MetaClass CardOwner { get; }
Property Value
Type Description
MetaClass

The card owner.

DataSource

Gets the source.

Declaration
public MetaClassDataSource DataSource { get; set; }
Property Value
Type Description
MetaClassDataSource

The source.

Extensions

Gets the extensions.

Declaration
public MetaObjectExtensionInfoCollection Extensions { get; }
Property Value
Type Description
MetaObjectExtensionInfoCollection

The extensions.

Fields

Gets the fields.

Declaration
public MetaFieldCollection Fields { get; }
Property Value
Type Description
MetaFieldCollection

The fields.

FriendlyName

Gets or sets the description.

Declaration
public string FriendlyName { get; set; }
Property Value
Type Description
System.String

The description.

IsBridge

Gets a value indicating whether this instance is bridge.

Declaration
public bool IsBridge { get; }
Property Value
Type Description
System.Boolean

true if this instance is bridge; otherwise, false.

IsCard

Gets a value indicating whether this instance is card.

Declaration
public bool IsCard { get; }
Property Value
Type Description
System.Boolean

true if this instance is card; otherwise, false.

ModuleDataStorages

Gets the module data storages.

Declaration
public ModuleDataStorageCollection ModuleDataStorages { get; }
Property Value
Type Description
ModuleDataStorageCollection

The module data storages.

Name

Gets or sets the name.

Declaration
public string Name { get; set; }
Property Value
Type Description
System.String

The name.

Owner

Gets or sets the owner.

Declaration
public string Owner { get; set; }
Property Value
Type Description
System.String

The owner.

PluralName

Gets or sets the name of the plural.

Declaration
public string PluralName { get; set; }
Property Value
Type Description
System.String

The name of the plural.

PrimaryKeyType

Gets or sets the type of the primary key.

Declaration
public PrimaryKeyIdValueType PrimaryKeyType { get; }
Property Value
Type Description
PrimaryKeyIdValueType

The type of the primary key.

SupportsCards

Gets a value indicating whether class supports cards.

Declaration
public bool SupportsCards { get; }
Property Value
Type Description
System.Boolean

true if class supports cards; otherwise, false.

TitleFieldName

Gets or sets the name of the title field.

Declaration
public string TitleFieldName { get; set; }
Property Value
Type Description
System.String

The name of the title field.

Validators

Gets the validators.

Declaration
public ValidatorCollection Validators { get; }
Property Value
Type Description
ValidatorCollection

The validators.

Methods

CreateAggregation(MetaClass, String, String, String, String)

Creates the aggregation.

Declaration
public MetaField CreateAggregation(MetaClass childMetaClass, string name, string friendlyName, string elementContainerRefFieldFriendlyName, string defaultElementFieldFriendlyName)
Parameters
Type Name Description
MetaClass childMetaClass

The child meta class.

System.String name

The name.

System.String friendlyName

Name of the friendly.

System.String elementContainerRefFieldFriendlyName

Name of the element container ref field friendly.

System.String defaultElementFieldFriendlyName

Name of the default element field friendly.

Returns
Type Description
MetaField
Remarks

Can be set only one aggregation reference between Container and Element

CreateAggregation(String, String, String, String, String)

Creates the aggregation.

Declaration
public MetaField CreateAggregation(string childMetaClassName, string name, string friendlyName, string elementContainerRefFieldFriendlyName, string defaultElementFieldFriendlyName)
Parameters
Type Name Description
System.String childMetaClassName

Name of the child meta class.

System.String name

The name.

System.String friendlyName

Name of the friendly.

System.String elementContainerRefFieldFriendlyName

Name of the element container ref field friendly.

System.String defaultElementFieldFriendlyName

Name of the default element field friendly.

Returns
Type Description
MetaField

CreateBackReference(MetaField, String, String)

Creates the back reference.

Declaration
public MetaField CreateBackReference(MetaField reference, string name, string friendlyName)
Parameters
Type Name Description
MetaField reference

The reference.

System.String name

The name.

System.String friendlyName

Name of the friendly.

Returns
Type Description
MetaField

CreateBackReference(String, String, String, String)

Creates the back reference.

Declaration
public MetaField CreateBackReference(string refMetaClassName, string refMetaFieldName, string name, string friendlyName)
Parameters
Type Name Description
System.String refMetaClassName

Name of the ref meta class.

System.String refMetaFieldName

Name of the ref meta field.

System.String name

The name.

System.String friendlyName

Name of the friendly.

Returns
Type Description
MetaField

CreateCardField(String, String, Boolean)

Creates the card field.

Declaration
public MetaField CreateCardField(string name, string friendly, bool isNullable)
Parameters
Type Name Description
System.String name

The name.

System.String friendly

The friendly.

System.Boolean isNullable

if set to true [is nullable].

Returns
Type Description
MetaField

CreateMetaField(MetaField)

Creates the meta field.

Declaration
public MetaField CreateMetaField(MetaField srcMetaField)
Parameters
Type Name Description
MetaField srcMetaField

The SRC meta field.

Returns
Type Description
MetaField

CreateMetaField(String, String, String, AttributeCollection)

Creates the meta field.

Declaration
public MetaField CreateMetaField(string name, string friendlyName, string typeName, AttributeCollection attributes)
Parameters
Type Name Description
System.String name

The name.

System.String friendlyName

Name of the friendly.

System.String typeName

Name of the type.

AttributeCollection attributes

The attributes.

Returns
Type Description
MetaField

CreateMetaField(String, String, String, Boolean, String, AttributeCollection)

Creates the meta field.

Declaration
public MetaField CreateMetaField(string name, string friendlyName, string typeName, bool isNullable, string defaultValue, AttributeCollection attributes)
Parameters
Type Name Description
System.String name

The name.

System.String friendlyName

Name of the friendly.

System.String typeName

The type.

System.Boolean isNullable

if set to true the fied will accept null.

System.String defaultValue

The default value.

AttributeCollection attributes

The attributes.

Returns
Type Description
MetaField

CreateMetaField(String, String, String, String, AttributeCollection)

Creates the meta field.

Declaration
public MetaField CreateMetaField(string name, string friendlyName, string typeName, string defaultValue, AttributeCollection attributes)
Parameters
Type Name Description
System.String name

The name.

System.String friendlyName

Name of the friendly.

System.String typeName

Name of the type.

System.String defaultValue

The default value.

AttributeCollection attributes

The attributes.

Returns
Type Description
MetaField

CreateReference(MetaClass, String, String, Boolean)

Creates the reference.

Declaration
public MetaField CreateReference(MetaClass parentMetaClass, string name, string friendlyName, bool isNullable)
Parameters
Type Name Description
MetaClass parentMetaClass

The parent meta class.

System.String name

The name.

System.String friendlyName

Name of the friendly.

System.Boolean isNullable

if set to true [is nullable].

Returns
Type Description
MetaField

CreateReference(MetaClass, String, String, Boolean, Boolean)

Creates the reference.

Declaration
public MetaField CreateReference(MetaClass parentMetaClass, string name, string friendlyName, bool isNullable, bool cascadeDelete)
Parameters
Type Name Description
MetaClass parentMetaClass

The parent meta class.

System.String name

The name.

System.String friendlyName

Name of the friendly.

System.Boolean isNullable

if set to true [is nullable].

System.Boolean cascadeDelete

if set to true [cascade delete].

Returns
Type Description
MetaField

CreateReference(String, String, String, Boolean)

Creates the reference.

Declaration
public MetaField CreateReference(string metaClassName, string name, string friendlyName, bool isNullable)
Parameters
Type Name Description
System.String metaClassName

Name of the meta class.

System.String name

The name.

System.String friendlyName

Name of the friendly.

System.Boolean isNullable

if set to true [is nullable].

Returns
Type Description
MetaField

CreateReference(String, String, String, Boolean, Boolean)

Creates the reference.

Declaration
public MetaField CreateReference(string metaClassName, string name, string friendlyName, bool isNullable, bool cascadeDelete)
Parameters
Type Name Description
System.String metaClassName

Name of the meta class.

System.String name

The name.

System.String friendlyName

Name of the friendly.

System.Boolean isNullable

if set to true [is nullable].

System.Boolean cascadeDelete

if set to true [cascade delete].

Returns
Type Description
MetaField

CreateReferencedField(MetaField, MetaField, String, String)

Creates the reference field.

Declaration
public MetaField CreateReferencedField(MetaField reference, MetaField referencedField, string name, string friendlyName)
Parameters
Type Name Description
MetaField reference

The reference.

MetaField referencedField

The referenced field.

System.String name

The name.

System.String friendlyName

Name of the friendly.

Returns
Type Description
MetaField

CreateReferencedField(String, String, String, String, String)

Creates the reference field.

Declaration
public MetaField CreateReferencedField(string referenceFieldName, string referencedClassName, string referencedFieldName, string name, string friendlyName)
Parameters
Type Name Description
System.String referenceFieldName

Name of the reference field.

System.String referencedClassName

Name of the referenced class.

System.String referencedFieldName

Name of the referenced field.

System.String name

The name.

System.String friendlyName

Name of the friendly.

Returns
Type Description
MetaField

DeleteMetaField(MetaField)

Deletes the meta field.

Declaration
public void DeleteMetaField(MetaField field)
Parameters
Type Name Description
MetaField field

The field.

DeleteMetaField(String)

Deletes the meta field.

Declaration
public void DeleteMetaField(string Name)
Parameters
Type Name Description
System.String Name

The name.

FindReferencesTo()

Finds the references.

Declaration
public MetaField[] FindReferencesTo()
Returns
Type Description
MetaField[]

FindReferencesTo(MetaClass)

Finds the references to.

Declaration
public static MetaField[] FindReferencesTo(MetaClass metaClass)
Parameters
Type Name Description
MetaClass metaClass

The meta class.

Returns
Type Description
MetaField[]

FindReferencesTo(MetaClass, Boolean)

Finds the references to.

Declaration
public static MetaField[] FindReferencesTo(MetaClass metaClass, bool includeCurrent)
Parameters
Type Name Description
MetaClass metaClass

The meta class.

System.Boolean includeCurrent

if set to true [include current].

Returns
Type Description
MetaField[]

FindReferencesTo(Boolean)

Finds the references to.

Declaration
public MetaField[] FindReferencesTo(bool includeCurrent)
Parameters
Type Name Description
System.Boolean includeCurrent

if set to true [include current].

Returns
Type Description
MetaField[]

FindReferencesTo(String)

Finds the references to.

Declaration
public static MetaField[] FindReferencesTo(string metaClassName)
Parameters
Type Name Description
System.String metaClassName

Name of the meta class.

Returns
Type Description
MetaField[]

FindReferencesTo(String, Boolean)

Finds the references to.

Declaration
public static MetaField[] FindReferencesTo(string metaClassName, bool includeCurrent)
Parameters
Type Name Description
System.String metaClassName

Name of the meta class.

System.Boolean includeCurrent

if set to true [include current].

Returns
Type Description
MetaField[]

FindReferencesWithoutBack()

Finds the single references.

Declaration
public MetaField[] FindReferencesWithoutBack()
Returns
Type Description
MetaField[]

FindReferencesWithoutBack(MetaClass)

Finds the single references.

Declaration
public static MetaField[] FindReferencesWithoutBack(MetaClass metaClass)
Parameters
Type Name Description
MetaClass metaClass

The meta class.

Returns
Type Description
MetaField[]

GetBackReference(MetaField)

Gets the back reference.

Declaration
public MetaField GetBackReference(MetaField field)
Parameters
Type Name Description
MetaField field

The field.

Returns
Type Description
MetaField

GetBackReference(String, String)

Gets the back references.

Declaration
public MetaField GetBackReference(string metaClassName, string metaFieldName)
Parameters
Type Name Description
System.String metaClassName

Name of the meta class.

System.String metaFieldName

Name of the meta field.

Returns
Type Description
MetaField

GetBackReferenceByName(String)

Gets the name of the back reference by.

Declaration
public MetaField GetBackReferenceByName(string referenceName)
Parameters
Type Name Description
System.String referenceName

Name of the reference.

Returns
Type Description
MetaField

GetBackReferences()

Gets the back references.

Declaration
public MetaField[] GetBackReferences()
Returns
Type Description
MetaField[]

GetBackReferences(String)

Gets the back references.

Declaration
public MetaField[] GetBackReferences(string metaClassName)
Parameters
Type Name Description
System.String metaClassName

Name of the meta class.

Returns
Type Description
MetaField[]

GetBridgeFields()

Gets the bridge fields.

Declaration
public MetaField[] GetBridgeFields()
Returns
Type Description
MetaField[]

GetCardField()

Gets the card field.

Declaration
public MetaField GetCardField()
Returns
Type Description
MetaField

GetCards()

Gets the cards.

Declaration
public MetaClass[] GetCards()
Returns
Type Description
MetaClass[]

Gets the links.

Declaration
public MetaField[] GetLinks()
Returns
Type Description
MetaField[]

GetPrimaryKeyFieldName()

Gets the name of the primary key field.

Declaration
public string GetPrimaryKeyFieldName()
Returns
Type Description
System.String

GetReferenceByName(String)

Gets the name of the reference by.

Declaration
public MetaField GetReferenceByName(string referenceName)
Parameters
Type Name Description
System.String referenceName

Name of the reference.

Returns
Type Description
MetaField

GetReferencedFields(String)

Gets the referenced fields.

Declaration
public MetaField[] GetReferencedFields(string referenceName)
Parameters
Type Name Description
System.String referenceName

Name of the reference.

Returns
Type Description
MetaField[]

GetReferences()

Gets the references.

Declaration
public MetaField[] GetReferences()
Returns
Type Description
MetaField[]

GetReferences(String)

Gets the references.

Declaration
public MetaField[] GetReferences(string metaClassName)
Parameters
Type Name Description
System.String metaClassName

Name of the meta class.

Returns
Type Description
MetaField[]

GetTableConfig()

Gets the table config.

Declaration
public TableConfig GetTableConfig()
Returns
Type Description
TableConfig

RegularExpressionValidatorIsValidName(String)

Declaration
public static bool RegularExpressionValidatorIsValidName(string name)
Parameters
Type Name Description
System.String name
Returns
Type Description
System.Boolean

ToString()

Returns a System.String that represents the current System.Object.

Declaration
public override string ToString()
Returns
Type Description
System.String

A System.String that represents the current System.Object.

Overrides
System.Object.ToString()

XmlDeserialize(String)

Deserializes MetaClass object.

Declaration
public static MetaClass XmlDeserialize(string str)
Parameters
Type Name Description
System.String str

The STR.

Returns
Type Description
MetaClass

XmlSerialize(MetaClass)

Serializes MetaClass object.

Declaration
public static string XmlSerialize(MetaClass item)
Parameters
Type Name Description
MetaClass item

The item.

Returns
Type Description
System.String

Explicit Interface Implementations

IChangeTracking.AcceptChanges()

Accepts the changes.

Declaration
void IChangeTracking.AcceptChanges()

IChangeTracking.IsChanged

Gets a value indicating whether this instance is changed.

Declaration
bool IChangeTracking.IsChanged { get; }
Returns
Type Description
System.Boolean

true if this instance is changed; otherwise, false.

Implements

Extension Methods