This topic has not yet been rated - Rate this topic

MetaTable Class

Represents the metadata that describes a table for use by Dynamic Data pages.

System.Object
  System.Web.DynamicData.MetaTable

Namespace:  System.Web.DynamicData
Assembly:  System.Web.DynamicData (in System.Web.DynamicData.dll)
public class MetaTable

The MetaTable type exposes the following members.

  Name Description
Public method MetaTable Initializes a new instance of the MetaTable class.
Top
  Name Description
Public property Attributes Gets the attributes that are associated with the table.
Public property Columns Gets the column collection for the table.
Public property DataContextPropertyName Gets the name of the table.
Public property DataContextType Gets the type of the data context that is associated with the table.
Public property DisplayColumn Gets the column that is used to display values when entries in this table are used as parents in foreign-key relationships.
Public property DisplayName Gets the name of the table in a user-friendly format.
Public property EntityType Gets the entity type that represents the table.
Public property ForeignKeyColumnsNames Gets a comma-separated list of foreign-key names.
Public property HasPrimaryKey Gets a value that indicates whether the table has a primary key.
Public property IsReadOnly Gets a value that indicates whether the table is read-only.
Public property ListActionPath Gets the action path of the list action for the table.
Public property Model Gets the meta model that the table belongs to.
Public property Name Gets the unique name of the table.
Public property PrimaryKeyColumns Gets the collection of columns that define the primary key.
Public property Provider Gets the provider for the table.
Public property RootEntityType Gets the root type of the entity's inheritance hierarchy.
Public property Scaffold Gets or sets a value that indicates whether the table should be displayed.
Public property SortColumn Gets the MetaColumn value that the table is sorted by.
Public property SortDescending Gets a value that indicates whether entries are sorted in descending order when they are used as parents in a foreign-key relationship.
Top
  Name Description
Protected method BuildAttributeCollection Creates the attribute collection.
Public method CanDelete Gets a value that indicates whether the specified user is allowed to perform delete operations.
Public method CanInsert Gets a value that indicates whether the specified user is allowed to perform insert operations.
Public method CanRead Gets a value that indicates whether the specified user is allowed to perform read operations.
Public method CanUpdate Gets a value that indicates whether the specified user is allowed to perform update operations.
Protected method CreateChildrenColumn Creates a new MetaChildrenColumn object.
Protected method CreateColumn Creates a MetaColumn object.
Public method CreateContext Returns the data context for the table.
Protected method CreateForeignKeyColumn Creates an object that contains foreign-key metadata.
Public method Static member CreateTable(ICustomTypeDescriptor) Creates the metadata for the specified table.
Public method Static member CreateTable(Type) Creates the metadata for the specified table.
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetActionPath(String) Returns the action path for the current table and the specified action.
Public method GetActionPath(String, IList<Object>) Returns the action path for the current table, specified action, and specified primary key.
Public method GetActionPath(String, Object) Returns the action path for the specified row by using the name of the action.
Public method GetActionPath(String, RouteValueDictionary) Returns the action path for the current table and for the specified action and routes.
Public method GetActionPath(String, IList<Object>, String) Appends query strings to the action path, based on the specified primary key and virtual path.
Public method GetActionPath(String, Object, String) Returns the action path for the specified row by using the name of the action and the virtual path of the action.
Public method GetColumn Returns the metadata for the specified column.
Public method GetColumnValuesFromRoute Gets the collection of column values.
Public method GetDataKeyFromRoute Retrieves the primary key of the entity from the route values.
Public method GetDisplayString Returns the value to use as the display string for an instance of a row when the row is used in foreign-key relationships.
Public method GetFilteredColumns Retrieves a list of columns that are filterable.
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetPrimaryKeyDictionary Retrieves a dictionary of primary-key names and values for the specified row.
Public method GetPrimaryKeyString(IList<Object>) Returns a comma-separated list of column values that represent the primary key for the specified row.
Public method GetPrimaryKeyString(Object) Returns a comma-separated list of column values that represent the primary key for the specified row.
Public method GetPrimaryKeyValues Returns a collection of column values that represent the primary key for the specified row.
Public method GetQuery() Returns the System.Linq.IQueryable instance for the entity type that represents the table.
Public method GetQuery(Object) Returns the System.Linq.IQueryable instance for the entity type that represents the table by using the data context.
Public method GetScaffoldColumns Returns a list of columns to display by using scaffolding.
Public method Static member GetTable Retrieves the metatable that is associated with the specified type.
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method Initialize Initializes data that may not be available when the constructor is called.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ResetMetadata Resets the cached metadata for the table.
Public method ToString Returns the name of the table. (Overrides Object.ToString().)
Public method TryGetColumn Returns a value that indicates whether a specified column can be found.
Public method Static member TryGetTable Retrieves the metatable that is associated with the specified type and table.
Top

The following example is part of the code-behind file for the Insert.aspx page template. The MetaTable instance is initialized in the Page_Load method. The title for the page is set to the table DisplayName property.

public partial class Insert : System.Web.UI.Page {
    protected MetaTable table;   

    protected void Page_Load(object sender, EventArgs e) {
        table = DetailsDataSource.GetTable();
        Title = table.DisplayName;
    }
}

.NET Framework

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ