/// <summary> /// /// </summary> /// <param name="tmd"></param> /// <param name="connStr"></param> public void SaveViewMetaData(ViewMetadata tmd, string connStr) { if (tmd != null) { SaveMetadata(tmd, connStr); ColumnMetadataAccess cma = new ColumnMetadataAccess(); foreach (ColumnMetaData item in tmd.Columns) { SaveMetadata(item, connStr); } } }
/// <summary> /// /// </summary> /// <param name="md"></param> /// <param name="connStr"></param> /// <returns></returns> public ViewMetadata GetViewMetaDetails(ViewMetadata md, string connStr) { if (md != null) { ColumnMetadataAccess cma = new ColumnMetadataAccess(); md.Columns = cma.GetColumnMetadata(md.Level1Name, md.Schema, connStr, Level1Types.View); return(md); } return(null); }
/// <summary> /// /// </summary> /// <param name="md"></param> /// <param name="connStr"></param> /// <returns></returns> public TableMetadata GetTableMetaDetails(TableMetadata md, string connStr) { if (md != null) { ColumnMetadataAccess cma = new ColumnMetadataAccess(); IndexEntityMetadataAccess ima = new IndexEntityMetadataAccess(); md.Columns = cma.GetColumnMetadata(md.Level1Name, md.Schema, connStr, Level1Types.Table); md.Indexes = ima.GetIndexMetadata(md.Level1Name, md.Schema, connStr); return(md); } return(null); }
/// <summary> /// /// </summary> /// <param name="connStr"></param> /// <returns></returns> public DatabaseMetaData GetMetaDataForDatabase(string connStr) { DatabaseMetaData dmd = new DatabaseMetaData(); StoredProcedureMetadataAccess spma = new StoredProcedureMetadataAccess(); TableMetadataAccess tma = new TableMetadataAccess(); ViewMetadataAccess vma = new ViewMetadataAccess(); dmd.Tables = tma.GetMasterTableMetadata(connStr); dmd.Views = vma.GetMasterViewMetadata(connStr); ColumnMetadataAccess cma = new ColumnMetadataAccess(); foreach (var item in dmd.Views) { item.Columns = cma.GetColumnMetadata(item.Level1Name, item.Schema, connStr, Level1Types.View); } dmd.StoredProcedures = spma.GetStoredProcedureMetaData(connStr); return(dmd); }