Editare

Partajați prin


EntityConnection.GetMetadataWorkspace Method

Definition

Important

This API is not CLS-compliant.

Returns the MetadataWorkspace associated with this EntityConnection.

public:
 System::Data::Metadata::Edm::MetadataWorkspace ^ GetMetadataWorkspace();
public System.Data.Metadata.Edm.MetadataWorkspace GetMetadataWorkspace ();
[System.CLSCompliant(false)]
public System.Data.Metadata.Edm.MetadataWorkspace GetMetadataWorkspace ();
member this.GetMetadataWorkspace : unit -> System.Data.Metadata.Edm.MetadataWorkspace
[<System.CLSCompliant(false)>]
member this.GetMetadataWorkspace : unit -> System.Data.Metadata.Edm.MetadataWorkspace
Public Function GetMetadataWorkspace () As MetadataWorkspace

Returns

The MetadataWorkspace associated with this EntityConnection.

Attributes

Exceptions

The inline connection string contains an invalid Metadata keyword value.

Remarks

A MetadataWorkspace is automatically created when the EntityConnection class is created. The creation process might throw metadata-specific exceptions. Metadata is loaded into memory and an Entity Data Model (EDM) application uses that metadata to access information about the underlying data source. For more information, see ADO.NET Metadata.

To avoid inadvertently putting objects such as System.Data.Common.CommandTrees and ObjectContext out of sync with their metadata, EntityConnection must lock its metadata. No changes to the connection string are allowed after the metadata is locked. The following are two scenarios in which metadata is locked:

When metadata is loaded, the EntityConnection verifies that the conceptual model, the storage model, and the mapping file are all present.

Applies to