protected IMetadataItem GetMetadataItemFromFile(string filePath) { string fileDirectory = Path.GetDirectoryName(filePath); string fileName = Path.GetFileName(filePath); // replace the original root folder with the one where the desired file is located ISettingsProvider settings = this._dataProviderServices.GetSettingsProvider(LocalFileProviderName); string originalFolder = settings.GetSetting(LocalFileProviderRootFolder, string.Empty); settings.SetSetting(LocalFileProviderRootFolder, fileDirectory); // get the metadata of the desired file IDataSourceMetadata localRoot = this._metadataLayerService.GetDataSourceMetadata(new ServerLocation(new DataSource { Id = DataSourceId, Provider = LocalFileProviderName })); IList <IMetadataItem> children = this._metadataLayerService.GetContentMetadata(localRoot); IMetadataItem item = children.FirstOrDefault(c => c.DisplayName == fileName); // restore the original root folder settings.SetSetting(LocalFileProviderRootFolder, originalFolder); return(item); }
public MetaObject(IDataSourceMetadata source) { this.source = source; }
public TablesMetaObject(IDataSourceMetadata source) : base(source) { this.mappable = false; this._type = "tables"; this._value = "tables"; }
public ViewMetaObject(IDataSourceMetadata source) : base(source) { this._type = "view"; }
public TableMetaObject(IDataSourceMetadata source) : base(source) { this._type = "table"; }
public DatabaseMetaObject(IDataSourceMetadata source) : base(source) { this._type = "database"; }
public SchemasMetaObject(IDataSourceMetadata source) : base(source) { this.mappable = false; this._type = "schemas"; this._value = "schemas"; }
public ColumnsMetaObject(IDataSourceMetadata source) : base(source) { this.mappable = false; this._type = "columns"; this._value = "columns"; }
public AbstractDatabaseMetaObject(IDataSourceMetadata source) : base(source) { }
public CatalogMetaObject(IDataSourceMetadata source) : base(source) { this._type = "catalog"; }
public ColumnMetaObject(IDataSourceMetadata source) : base(source) { this._type = "column"; }
public SchemaMetaObject(IDataSourceMetadata source) : base(source) { this._type = "schema"; }