C# Class EFUtility.CodeGenerationTools.MetadataLoader

Responsible for loading an EdmItemCollection from a .edmx file or .csdl files
Exibir arquivo Open project: jradxl/Entity-Framework-Code-Generation-Tools-Experiments Class Usage Examples

Public Methods

Method Description
CreateEdmItemCollection ( string sourcePath ) : System.Data.Metadata.Edm.EdmItemCollection

Create an EdmItemCollection loaded with the metadata provided

GetModelNamespace ( string sourcePath ) : string

Gets the Model Namespace from the provided schema file.

MetadataLoader ( object textTransformation ) : System

Initializes an MetadataLoader Instance with the TextTransformation (T4 generated class) that is currently running

TryCreateEdmItemCollection ( string sourcePath, System.Data.Metadata.Edm.EdmItemCollection &edmItemCollection ) : bool

Attempts to create a EdmItemCollection from the specified metadata file

TryCreateEdmItemCollection ( string sourcePath, string referenceSchemas, System.Data.Metadata.Edm.EdmItemCollection &edmItemCollection ) : bool

Attempts to create a EdmItemCollection from the specified metadata file

TryCreateStorageMappingItemCollection ( string sourcePath, System.Data.Metadata.Edm.EdmItemCollection edmItemCollection, System.Data.Metadata.Edm.StoreItemCollection storeItemCollection, System.Data.Mapping.StorageMappingItemCollection &storageMappingItemCollection ) : bool

Attempts to create a StorageMappingItemCollection from the specified metadata file, EdmItemCollection, and StoreItemCollection

TryCreateStoreItemCollection ( string sourcePath, System.Data.Metadata.Edm.StoreItemCollection &storeItemCollection ) : bool

Attempts to create a StoreItemCollection from the specified metadata file

TryLoadAllMetadata ( string inputFile, MetadataWorkspace &metadataWorkspace ) : bool

Load the metadata for Edm, Store, and Mapping collections and register them with a new MetadataWorkspace, returns false if any of the parts can't be created, some of the ItemCollections may be registered and usable even if false is returned

Private Methods

Method Description
DefineMetadata ( ) : void
ValidateInputPath ( string sourcePath, DynamicTextTransformation textTransformation ) : bool

Returns true if the specified file path is valid

Method Details

CreateEdmItemCollection() public method

Create an EdmItemCollection loaded with the metadata provided
public CreateEdmItemCollection ( string sourcePath ) : System.Data.Metadata.Edm.EdmItemCollection
sourcePath string
return System.Data.Metadata.Edm.EdmItemCollection

GetModelNamespace() public method

Gets the Model Namespace from the provided schema file.
public GetModelNamespace ( string sourcePath ) : string
sourcePath string
return string

MetadataLoader() public method

Initializes an MetadataLoader Instance with the TextTransformation (T4 generated class) that is currently running
public MetadataLoader ( object textTransformation ) : System
textTransformation object
return System

TryCreateEdmItemCollection() public method

Attempts to create a EdmItemCollection from the specified metadata file
public TryCreateEdmItemCollection ( string sourcePath, System.Data.Metadata.Edm.EdmItemCollection &edmItemCollection ) : bool
sourcePath string
edmItemCollection System.Data.Metadata.Edm.EdmItemCollection
return bool

TryCreateEdmItemCollection() public method

Attempts to create a EdmItemCollection from the specified metadata file
public TryCreateEdmItemCollection ( string sourcePath, string referenceSchemas, System.Data.Metadata.Edm.EdmItemCollection &edmItemCollection ) : bool
sourcePath string
referenceSchemas string
edmItemCollection System.Data.Metadata.Edm.EdmItemCollection
return bool

TryCreateStorageMappingItemCollection() public method

Attempts to create a StorageMappingItemCollection from the specified metadata file, EdmItemCollection, and StoreItemCollection
public TryCreateStorageMappingItemCollection ( string sourcePath, System.Data.Metadata.Edm.EdmItemCollection edmItemCollection, System.Data.Metadata.Edm.StoreItemCollection storeItemCollection, System.Data.Mapping.StorageMappingItemCollection &storageMappingItemCollection ) : bool
sourcePath string
edmItemCollection System.Data.Metadata.Edm.EdmItemCollection
storeItemCollection System.Data.Metadata.Edm.StoreItemCollection
storageMappingItemCollection System.Data.Mapping.StorageMappingItemCollection
return bool

TryCreateStoreItemCollection() public method

Attempts to create a StoreItemCollection from the specified metadata file
public TryCreateStoreItemCollection ( string sourcePath, System.Data.Metadata.Edm.StoreItemCollection &storeItemCollection ) : bool
sourcePath string
storeItemCollection System.Data.Metadata.Edm.StoreItemCollection
return bool

TryLoadAllMetadata() public method

Load the metadata for Edm, Store, and Mapping collections and register them with a new MetadataWorkspace, returns false if any of the parts can't be created, some of the ItemCollections may be registered and usable even if false is returned
public TryLoadAllMetadata ( string inputFile, MetadataWorkspace &metadataWorkspace ) : bool
inputFile string
metadataWorkspace MetadataWorkspace
return bool