Class MetaObject
Inheritance
Implements
Inherited Members
Namespace: Mediachase.BusinessFoundation.Data.Meta
Assembly: Mediachase.BusinessFoundation.Data.dll
Version: 13.30.0Syntax
public class MetaObject : IMetaObjectChangeTracking, IChangeTracking, IMetaObjectDeleteTracking, IDisposable, ICloneable, IXmlSerializable
Constructors
MetaObject()
Declaration
public MetaObject()
MetaObject(MetaClass)
Initializes a new instance of the MetaObject class.
Declaration
public MetaObject(MetaClass metaType)
Parameters
Type | Name | Description |
---|---|---|
MetaClass | metaType | Type of the meta. |
MetaObject(MetaClass, MetaObjectOptions)
Initializes a new instance of the MetaObject class.
Declaration
public MetaObject(MetaClass metaType, MetaObjectOptions options)
Parameters
Type | Name | Description |
---|---|---|
MetaClass | metaType | Meta Type of the object. |
MetaObjectOptions | options | The options. |
MetaObject(MetaClass, PrimaryKeyId)
Initializes a new instance of the MetaObject class.
Declaration
public MetaObject(MetaClass metaType, PrimaryKeyId primaryKeyId)
Parameters
Type | Name | Description |
---|---|---|
MetaClass | metaType | Type of the meta. |
PrimaryKeyId | primaryKeyId | The primary key id. |
MetaObject(MetaClass, PrimaryKeyId, MetaObjectOptions)
Initializes a new instance of the MetaObject class.
Declaration
public MetaObject(MetaClass metaType, PrimaryKeyId primaryKeyId, MetaObjectOptions options)
Parameters
Type | Name | Description |
---|---|---|
MetaClass | metaType | Meta Type of the object. |
PrimaryKeyId | primaryKeyId | The primary key id. |
MetaObjectOptions | options | The options. |
MetaObject(MetaClass, CustomTableRow)
Declaration
public MetaObject(MetaClass metaType, CustomTableRow row)
Parameters
Type | Name | Description |
---|---|---|
MetaClass | metaType | |
CustomTableRow | row |
MetaObject(MetaClass, CustomTableRow, MetaObjectOptions)
Initializes a new instance of the MetaObject class.
Declaration
public MetaObject(MetaClass metaType, CustomTableRow row, MetaObjectOptions options)
Parameters
Type | Name | Description |
---|---|---|
MetaClass | metaType | Type of the meta. |
CustomTableRow | row | The row. |
MetaObjectOptions | options | The options. |
Properties
InnerExtensions
Gets or sets the inner extensions.
Declaration
protected Dictionary<MetaObjectExtensionInfo, IMetaObjectExtension> InnerExtensions { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<MetaObjectExtensionInfo, IMetaObjectExtension> | The inner extensions. |
IsChanged
Determines whether this instance is changed.
Declaration
protected virtual bool IsChanged { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
IsDeleted
Declaration
protected virtual bool IsDeleted { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsValid
Gets or sets a value indicating whether this instance is valid.
Declaration
public bool IsValid { get; protected set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Item[Int32]
Gets or sets the System.Object at the specified index.
Declaration
public object this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Property Value
Type | Description |
---|---|
System.Object |
Item[String]
Gets or sets the System.Object with the specified field name.
Declaration
public object this[string fieldName] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName |
Property Value
Type | Description |
---|---|
System.Object |
ObjectState
Gets the state.
Declaration
public MetaObjectState ObjectState { get; protected set; }
Property Value
Type | Description |
---|---|
MetaObjectState | The state. |
Options
Gets the options.
Declaration
protected MetaObjectOptions Options { get; }
Property Value
Type | Description |
---|---|
MetaObjectOptions | The options. |
PrimaryKeyId
Gets the primary key id.
Declaration
public PrimaryKeyId? PrimaryKeyId { get; protected set; }
Property Value
Type | Description |
---|---|
System.Nullable<PrimaryKeyId> | The primary key id. |
Properties
Gets the properties.
Declaration
public MetaObjectPropertyCollection Properties { get; }
Property Value
Type | Description |
---|---|
MetaObjectPropertyCollection | The properties. |
Validators
Gets the validatord.
Declaration
public ValidatorCollection Validators { get; }
Property Value
Type | Description |
---|---|
ValidatorCollection | The validatord. |
Methods
AcceptChanges()
Accepts the changes.
Declaration
protected virtual void AcceptChanges()
Clone()
Creates a new object that is a copy of the current instance.
Declaration
public object Clone()
Returns
Type | Description |
---|---|
System.Object | A new object that is a copy of this instance. |
Delete()
Deletes this instance.
Declaration
public virtual void Delete()
Dispose()
Declaration
public void Dispose()
Dispose(Boolean)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
GetCardMetaType()
Gets the type of the card meta.
Declaration
public MetaClass GetCardMetaType()
Returns
Type | Description |
---|---|
MetaClass |
GetCardProperty()
Gets the card property.
Declaration
public MetaObjectProperty GetCardProperty()
Returns
Type | Description |
---|---|
MetaObjectProperty |
GetChangedFields()
Gets the changed fields.
Declaration
protected virtual string[] GetChangedFields()
Returns
Type | Description |
---|---|
System.String[] |
GetExtension(Type)
Gets the extension.
Declaration
public IMetaObjectExtension GetExtension(Type extensionType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | extensionType | Type of the extension. |
Returns
Type | Description |
---|---|
IMetaObjectExtension |
GetExtension<T>()
Gets the extension.
Declaration
public T GetExtension<T>()
where T : IMetaObjectExtension, new()
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
GetMetaType()
Gets the meta type of the object.
Declaration
public MetaClass GetMetaType()
Returns
Type | Description |
---|---|
MetaClass |
GetOriginalValue(String)
Gets the original value.
Declaration
protected virtual object GetOriginalValue(string fieldName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
Returns
Type | Description |
---|---|
System.Object |
GetSchema()
This property is reserved, apply the System.Xml.Serialization.XmlSchemaProviderAttribute to the class instead.
Declaration
protected virtual XmlSchema GetSchema()
Returns
Type | Description |
---|---|
System.Xml.Schema.XmlSchema | An System.Xml.Schema.XmlSchema that describes the XML representation of the object that is produced by the System.Xml.Serialization.IXmlSerializable.WriteXml(System.Xml.XmlWriter) method and consumed by the System.Xml.Serialization.IXmlSerializable.ReadXml(System.Xml.XmlReader) method. |
GetTotalCount(MetaClass, FilterElement[])
Gets the total count.
Declaration
public static int GetTotalCount(MetaClass metaType, params FilterElement[] filters)
Parameters
Type | Name | Description |
---|---|---|
MetaClass | metaType | Type of the meta. |
FilterElement[] | filters | The filters. |
Returns
Type | Description |
---|---|
System.Int32 |
GetUniqueKey(MetaClass, Nullable<PrimaryKeyId>)
Gets the unique key.
Declaration
public static string GetUniqueKey(MetaClass metaClass, PrimaryKeyId? primaryKeyId)
Parameters
Type | Name | Description |
---|---|---|
MetaClass | metaClass | The meta class. |
System.Nullable<PrimaryKeyId> | primaryKeyId | The primary key id. |
Returns
Type | Description |
---|---|
System.String |
GetUniqueKey(MetaObject)
Gets the unique key.
Declaration
public static string GetUniqueKey(MetaObject metaObject)
Parameters
Type | Name | Description |
---|---|---|
MetaObject | metaObject | The meta object. |
Returns
Type | Description |
---|---|
System.String |
GetUniqueKey(String, Nullable<PrimaryKeyId>)
Gets the unique key.
Declaration
public static string GetUniqueKey(string metaClassName, PrimaryKeyId? primaryKeyId)
Parameters
Type | Name | Description |
---|---|---|
System.String | metaClassName | Name of the meta class. |
System.Nullable<PrimaryKeyId> | primaryKeyId | The primary key id. |
Returns
Type | Description |
---|---|
System.String |
InitExtensions()
Inits the extensions.
Declaration
protected void InitExtensions()
IsExtensionActivated(Type)
Determines whether [is extension activated] [the specified extension type].
Declaration
protected virtual bool IsExtensionActivated(Type extensionType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | extensionType | Type of the extension. |
Returns
Type | Description |
---|---|
System.Boolean |
|
IsExtensionActivated<T>()
Determines whether is extension activated.
Declaration
protected bool IsExtensionActivated<T>()
where T : IMetaObjectExtension, new()
Returns
Type | Description |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
T |
IsFieldChanged(String)
Declaration
protected virtual bool IsFieldChanged(string fieldName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName |
Returns
Type | Description |
---|---|
System.Boolean |
List(MetaClass)
Lists the specified meta type.
Declaration
public static MetaObject[] List(MetaClass metaType)
Parameters
Type | Name | Description |
---|---|---|
MetaClass | metaType | Type of the meta. |
Returns
Type | Description |
---|---|
MetaObject[] |
List(MetaClass, FilterElement[])
Lists the specified meta type.
Declaration
public static MetaObject[] List(MetaClass metaType, params FilterElement[] filters)
Parameters
Type | Name | Description |
---|---|---|
MetaClass | metaType | Type of the meta. |
FilterElement[] | filters | The filters. |
Returns
Type | Description |
---|---|
MetaObject[] |
List(MetaClass, FilterElementCollection, SortingElementCollection)
Lists the specified meta type.
Declaration
public static MetaObject[] List(MetaClass metaType, FilterElementCollection filters, SortingElementCollection sorting)
Parameters
Type | Name | Description |
---|---|---|
MetaClass | metaType | Type of the meta. |
FilterElementCollection | filters | The filters. |
SortingElementCollection | sorting | The sorting. |
Returns
Type | Description |
---|---|
MetaObject[] |
List(MetaClass, FilterElementCollection, SortingElementCollection, Int32, Int32)
Lists the specified meta type.
Declaration
public static MetaObject[] List(MetaClass metaType, FilterElementCollection filters, SortingElementCollection sorting, int start, int count)
Parameters
Type | Name | Description |
---|---|---|
MetaClass | metaType | Type of the meta. |
FilterElementCollection | filters | The filters. |
SortingElementCollection | sorting | The sorting. |
System.Int32 | start | The start. |
System.Int32 | count | The count. |
Returns
Type | Description |
---|---|
MetaObject[] |
List(MetaClass, SortingElement[])
Lists the specified meta type.
Declaration
public static MetaObject[] List(MetaClass metaType, params SortingElement[] sorting)
Parameters
Type | Name | Description |
---|---|---|
MetaClass | metaType | Type of the meta. |
SortingElement[] | sorting | The sorting. |
Returns
Type | Description |
---|---|
MetaObject[] |
List<T>(MetaClass)
Lists this instance.
Declaration
public static T[] List<T>(MetaClass metaType)
where T : MetaObject
Parameters
Type | Name | Description |
---|---|---|
MetaClass | metaType |
Returns
Type | Description |
---|---|
T[] |
Type Parameters
Name | Description |
---|---|
T |
Remarks
This might perform badly on big collection. Use with caution.
List<T>(MetaClass, FilterElement[])
Lists the specified meta type.
Declaration
public static T[] List<T>(MetaClass metaType, params FilterElement[] filters)
where T : MetaObject
Parameters
Type | Name | Description |
---|---|---|
MetaClass | metaType | Type of the meta. |
FilterElement[] | filters | The filters. |
Returns
Type | Description |
---|---|
T[] |
Type Parameters
Name | Description |
---|---|
T |
List<T>(MetaClass, FilterElementCollection, SortingElementCollection)
Lists the specified meta type.
Declaration
public static T[] List<T>(MetaClass metaType, FilterElementCollection filters, SortingElementCollection sorting)
where T : MetaObject
Parameters
Type | Name | Description |
---|---|---|
MetaClass | metaType | Type of the meta. |
FilterElementCollection | filters | The filters. |
SortingElementCollection | sorting | The sorting. |
Returns
Type | Description |
---|---|
T[] |
Type Parameters
Name | Description |
---|---|
T |
List<T>(MetaClass, FilterElementCollection, SortingElementCollection, MetaField[])
Lists the specified meta type.
Declaration
public static T[] List<T>(MetaClass metaType, FilterElementCollection filters, SortingElementCollection sorting, MetaField[] availableFields)
where T : MetaObject
Parameters
Type | Name | Description |
---|---|---|
MetaClass | metaType | Type of the meta. |
FilterElementCollection | filters | The filters. |
SortingElementCollection | sorting | The sorting. |
MetaField[] | availableFields | The available fields. |
Returns
Type | Description |
---|---|
T[] |
Type Parameters
Name | Description |
---|---|
T |
List<T>(MetaClass, FilterElementCollection, SortingElementCollection, Int32, Int32)
Lists the specified meta type.
Declaration
public static T[] List<T>(MetaClass metaType, FilterElementCollection filters, SortingElementCollection sorting, int start, int count)
where T : MetaObject
Parameters
Type | Name | Description |
---|---|---|
MetaClass | metaType | Type of the meta. |
FilterElementCollection | filters | The filters. |
SortingElementCollection | sorting | The sorting. |
System.Int32 | start | The start. |
System.Int32 | count | The count. |
Returns
Type | Description |
---|---|
T[] |
Type Parameters
Name | Description |
---|---|
T |
List<T>(MetaClass, SortingElement[])
Lists the specified meta type.
Declaration
public static T[] List<T>(MetaClass metaType, params SortingElement[] sorting)
where T : MetaObject
Parameters
Type | Name | Description |
---|---|---|
MetaClass | metaType | Type of the meta. |
SortingElement[] | sorting | The sorting. |
Returns
Type | Description |
---|---|
T[] |
Type Parameters
Name | Description |
---|---|
T |
Remarks
This might perform badly on big collection. Use with caution.
LoadAllExtensions()
Declaration
protected virtual void LoadAllExtensions()
LoadCard(CustomTableRow)
Declaration
protected void LoadCard(CustomTableRow srcRow)
Parameters
Type | Name | Description |
---|---|---|
CustomTableRow | srcRow |
LoadCardProperties(MetaClass)
Loads the card.
Declaration
protected void LoadCardProperties(MetaClass cardMetaType)
Parameters
Type | Name | Description |
---|---|---|
MetaClass | cardMetaType | Type of the card meta. |
LoadCardProperties(CustomTableRow, MetaClass)
Declaration
protected void LoadCardProperties(CustomTableRow srcRow, MetaClass cardMetaType)
Parameters
Type | Name | Description |
---|---|---|
CustomTableRow | srcRow | |
MetaClass | cardMetaType |
LoadExtensions(MetaObjectExtensionActivationType)
Loads the extensions.
Declaration
protected virtual void LoadExtensions(MetaObjectExtensionActivationType activationType)
Parameters
Type | Name | Description |
---|---|---|
MetaObjectExtensionActivationType | activationType | Type of the activation. |
OnClone(MetaObject)
Copies the parameters.
Declaration
protected virtual void OnClone(MetaObject destMetaObject)
Parameters
Type | Name | Description |
---|---|---|
MetaObject | destMetaObject | The destination meta object. |
OnDeleted()
Called after a delete operation.
Declaration
protected virtual void OnDeleted()
OnDeleting()
Called before a delete operation.
Declaration
protected virtual void OnDeleting()
OnLoad()
Called when object is loaded.
Declaration
protected virtual void OnLoad()
OnReadXml(XmlReader)
Declaration
protected virtual void OnReadXml(XmlReader reader)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlReader | reader |
OnSaved()
Called when [saved].
Declaration
protected virtual void OnSaved()
OnSaving()
Called when [saving].
Declaration
protected virtual void OnSaving()
OnTransactionCommitted()
Called when [transaction committed].
Declaration
protected virtual void OnTransactionCommitted()
OnValidate()
Declaration
protected virtual void OnValidate()
OnWriteXml(XmlWriter)
Declaration
protected virtual void OnWriteXml(XmlWriter writer)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlWriter | writer |
RaiseDeleteEmbeddedExtensions()
Raises the delete embedded services.
Declaration
protected virtual void RaiseDeleteEmbeddedExtensions()
RaiseDisposeEmbeddedExtensions()
Raises the dispose embedded services.
Declaration
protected virtual void RaiseDisposeEmbeddedExtensions()
RaisePreSaveEmbeddedExtensions()
Raises the save embedded services.
Declaration
protected virtual void RaisePreSaveEmbeddedExtensions()
RaiseSaveEmbeddedExtensions()
Raises the save embedded services.
Declaration
protected virtual void RaiseSaveEmbeddedExtensions()
ReadObjectFromXml(XmlReader)
Declaration
protected virtual object ReadObjectFromXml(XmlReader reader)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlReader | reader |
Returns
Type | Description |
---|---|
System.Object |
ReadXml(XmlReader)
Generates an object from its XML representation.
Declaration
protected void ReadXml(XmlReader reader)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlReader | reader | The System.Xml.XmlReader stream from which the object is deserialized. |
Save()
Saves this instance.
Declaration
public void Save()
Save(Boolean)
Saves this instance.
Declaration
public virtual void Save(bool forceSave)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | forceSave | if set to |
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
TryGetExtension(Type, out IMetaObjectExtension)
Tries the get extension.
Declaration
public virtual bool TryGetExtension(Type extensionType, out IMetaObjectExtension extenson)
Parameters
Type | Name | Description |
---|---|---|
System.Type | extensionType | Type of the extension. |
IMetaObjectExtension | extenson | The extenson. |
Returns
Type | Description |
---|---|
System.Boolean |
TryGetExtension<T>(out T)
Tries the get extension.
Declaration
public bool TryGetExtension<T>(out T extenson)
where T : IMetaObjectExtension, new()
Parameters
Type | Name | Description |
---|---|---|
T | extenson | The extenson. |
Returns
Type | Description |
---|---|
System.Boolean |
Type Parameters
Name | Description |
---|---|
T |
Validate()
Declaration
public void Validate()
WriteObjectToXml(XmlWriter, Object)
Declaration
protected virtual void WriteObjectToXml(XmlWriter writer, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlWriter | writer | |
System.Object | value |
WriteXml(XmlWriter)
Converts an object into its XML representation.
Declaration
protected void WriteXml(XmlWriter writer)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlWriter | writer | The System.Xml.XmlWriter stream to which the object is serialized. |
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 |
|
IMetaObjectChangeTracking.GetChangedFields()
Gets the modified fields.
Declaration
string[] IMetaObjectChangeTracking.GetChangedFields()
Returns
Type | Description |
---|---|
System.String[] | The modified fields. |
IMetaObjectChangeTracking.GetOriginalValue(String)
Gets the original value.
Declaration
object IMetaObjectChangeTracking.GetOriginalValue(string fieldName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
Returns
Type | Description |
---|---|
System.Object |
IMetaObjectChangeTracking.IsFieldChanged(String)
Determines whether [is field changed] [the specified field name].
Declaration
bool IMetaObjectChangeTracking.IsFieldChanged(string fieldName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fieldName | Name of the field. |
Returns
Type | Description |
---|---|
System.Boolean |
|
IMetaObjectChangeTracking.PrimaryKeyId
Gets the primary key id.
Declaration
int IMetaObjectChangeTracking.PrimaryKeyId { get; }
Returns
Type | Description |
---|---|
System.Int32 | The primary key id. |
IMetaObjectDeleteTracking.IsDeleted
Gets a value indicating whether this instance is deleted.
Declaration
bool IMetaObjectDeleteTracking.IsDeleted { get; }
Returns
Type | Description |
---|---|
System.Boolean |
|
IMetaObjectDeleteTracking.PrimaryKeyId
Gets the primary key id.
Declaration
PrimaryKeyId IMetaObjectDeleteTracking.PrimaryKeyId { get; }
Returns
Type | Description |
---|---|
PrimaryKeyId | The primary key id. |