Export (0) Print
Expand All

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.

  NameDescription
Public methodMetaTableInitializes a new instance of the MetaTable class.
Top

  NameDescription
Public propertyAttributesGets the attributes that are associated with the table.
Public propertyColumnsGets the column collection for the table.
Public propertyDataContextPropertyNameGets the name of the table.
Public propertyDataContextTypeGets the type of the data context that is associated with the table.
Public propertyDisplayColumnGets the column that is used to display values when entries in this table are used as parents in foreign-key relationships.
Public propertyDisplayNameGets the name of the table in a user-friendly format.
Public propertyEntityTypeGets the entity type that represents the table.
Public propertyForeignKeyColumnsNamesGets a comma-separated list of foreign-key names.
Public propertyHasPrimaryKeyGets a value that indicates whether the table has a primary key.
Public propertyIsReadOnlyGets a value that indicates whether the table is read-only.
Public propertyListActionPathGets the action path of the list action for the table.
Public propertyModelGets the meta model that the table belongs to.
Public propertyNameGets the unique name of the table.
Public propertyPrimaryKeyColumnsGets the collection of columns that define the primary key.
Public propertyProviderGets the provider for the table.
Public propertyRootEntityTypeGets the root type of the entity's inheritance hierarchy.
Public propertyScaffoldGets or sets a value that indicates whether the table should be displayed.
Public propertySortColumnGets the MetaColumn value that the table is sorted by.
Public propertySortDescendingGets a value that indicates whether entries are sorted in descending order when they are used as parents in a foreign-key relationship.
Top

  NameDescription
Protected methodBuildAttributeCollectionCreates the attribute collection.
Public methodCanDeleteGets a value that indicates whether the specified user is allowed to perform delete operations.
Public methodCanInsertGets a value that indicates whether the specified user is allowed to perform insert operations.
Public methodCanReadGets a value that indicates whether the specified user is allowed to perform read operations.
Public methodCanUpdateGets a value that indicates whether the specified user is allowed to perform update operations.
Protected methodCreateChildrenColumnCreates a new MetaChildrenColumn object.
Protected methodCreateColumnCreates a MetaColumn object.
Public methodCreateContextReturns the data context for the table.
Protected methodCreateForeignKeyColumnCreates an object that contains foreign-key metadata.
Public methodStatic memberCreateTable(ICustomTypeDescriptor)Creates the metadata for the specified table.
Public methodStatic memberCreateTable(Type)Creates the metadata for the specified table.
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetActionPath(String)Returns the action path for the current table and the specified action.
Public methodGetActionPath(String, IList<Object>)Returns the action path for the current table, specified action, and specified primary key.
Public methodGetActionPath(String, Object)Returns the action path for the specified row by using the name of the action.
Public methodGetActionPath(String, RouteValueDictionary)Returns the action path for the current table and for the specified action and routes.
Public methodGetActionPath(String, IList<Object>, String)Appends query strings to the action path, based on the specified primary key and virtual path.
Public methodGetActionPath(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 methodGetColumnReturns the metadata for the specified column.
Public methodGetColumnValuesFromRouteGets the collection of column values.
Public methodGetDataKeyFromRouteRetrieves the primary key of the entity from the route values.
Public methodGetDisplayStringReturns the value to use as the display string for an instance of a row when the row is used in foreign-key relationships.
Public methodGetFilteredColumnsRetrieves a list of columns that are filterable.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetPrimaryKeyDictionaryRetrieves a dictionary of primary-key names and values for the specified row.
Public methodGetPrimaryKeyString(IList<Object>)Returns a comma-separated list of column values that represent the primary key for the specified row.
Public methodGetPrimaryKeyString(Object)Returns a comma-separated list of column values that represent the primary key for the specified row.
Public methodGetPrimaryKeyValuesReturns a collection of column values that represent the primary key for the specified row.
Public methodGetQuery()Returns the System.Linq.IQueryable instance for the entity type that represents the table.
Public methodGetQuery(Object)Returns the System.Linq.IQueryable instance for the entity type that represents the table by using the data context.
Public methodGetScaffoldColumnsReturns a list of columns to display by using scaffolding.
Public methodStatic memberGetTableRetrieves the metatable that is associated with the specified type.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodInitializeInitializes data that may not be available when the constructor is called.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodResetMetadataResets the cached metadata for the table.
Public methodToStringReturns the name of the table. (Overrides Object.ToString().)
Public methodTryGetColumnReturns a value that indicates whether a specified column can be found.
Public methodStatic memberTryGetTableRetrieves 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.5, 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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.
Show:
© 2014 Microsoft