EntityConnection.GetMetadataWorkspace Method



This API is not CLS-compliant.

Returns the MetadataWorkspace associated with this EntityConnection.

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



The MetadataWorkspace associated with this EntityConnection.



The inline connection string contains an invalid Metadata keyword value.


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