public DbCategory GetDbExplorer(string connName) { DbCategory dbCategory = new DbCategory(); ConnectionSchema connSchema = db.GetSchema().Connections.GetItem(connName); return(GetDbExplorer(connSchema)); }
public DataBase GetRepositoryInit(DataBaseType dbType, ConnectionSchema connectDetail) { var dataBaseRepo = dbType.GetDataBase(); dataBaseRepo.ConnectionString = connectDetail.ConnectionString; return(dataBaseRepo); }
public FileBase GetRepositoryInit(FileType fileType, ConnectionSchema connectionSchema) { var fileRepo = fileType.GetFileBase(); fileRepo.PathFile = connectionSchema.ConnectionString; return(fileRepo); }
public DbCategory GetDbExplorer(ConnectionSchema conSchema) { DbCategory dbCategory = new DbCategory(); dbCategory.DbName = conSchema.Id; dbCategory.DbTitle = conSchema.Title; if (string.IsNullOrEmpty(dbCategory.DbTitle)) { dbCategory.DbTitle = dbCategory.DbName; } DbConnection conn = null; try { conn = db.GetConnection(conSchema.Id); } catch (Exception e) { dbCategory.Err = e.Message; return(dbCategory); } DataTable dt = conn.GetSchema("Tables"); DataView dv = dt.DefaultView; dv.Sort = "TABLE_NAME"; foreach (DataRowView dr in dv) { ObjectDocket od = new ObjectDocket(); od.Name = dr["TABLE_NAME"].ToString(); od.Title = dr["TABLE_NAME"].ToString(); string tbType = dr["TABLE_TYPE"].ToString(); if (tbType.Equals("VIEW")) { dbCategory.Views.Add(od); } // if (tbType.Equals("TABLE")) else { if (!od.Name.Equals("sysdiagrams", StringComparison.OrdinalIgnoreCase)) { if (!od.Name.Equals("dtproperties", StringComparison.OrdinalIgnoreCase)) { dbCategory.Tables.Add(od); } } } } return(dbCategory); }
public NonSqlBase <TNonSqlDataBase> GetRepositoryInit <TNonSqlDataBase>(NonSqlType nonSqlType, ConnectionSchema connectDetail) { var nonSqlBaseRepo = nonSqlType.GetNonSqlBase <TNonSqlDataBase>(); nonSqlBaseRepo.ClientBase = new ClientModel { ConnectionString = connectDetail.ConnectionString }; return(nonSqlBaseRepo); }
protected RepositoryBaseNonSql(IConnectionProvider connectionProvider, NonSqlType nonSqlType) { NonSqlType = nonSqlType; ConnectionSchema = connectionProvider.ConnectionSchemas.FirstOrDefault(x => x.SourceType == SourceType.NonSql && x.NonSqlType == nonSqlType); NonSqlBaseRepo = new NonSqlRepositoryInit().GetRepositoryInit <TNonSqlDataBase>(nonSqlType, ConnectionSchema); }
protected RepositoryBaseFile(IConnectionProvider connectionProvider, FileType fileType) { FileType = fileType; ConnectionSchema = connectionProvider.ConnectionSchemas.FirstOrDefault(x => x.SourceType == SourceType.File && x.FileType == fileType); FileBaseRepo = new FileRepositoryInit().GetRepositoryInit(fileType, ConnectionSchema); }