/** * Find column name of generated key. * * @param logicTableName logic table name * @return column name of generated key */ public string FindGenerateKeyColumnName(string logicTableName) { return(TableRules .Where(o => o.LogicTable.EqualsIgnoreCase(logicTableName) && o.GetGenerateKeyColumn() != null) .Select(o => o.GetGenerateKeyColumn()).FirstOrDefault()); }
/** * Get logic table names based on actual table name. * * @param actualTableName actual table name * @return logic table name */ public ICollection <string> GetLogicTableNames(string actualTableName) { return(TableRules.Where(o => o.IsExisted(actualTableName)).Select(o => o.LogicTable).ToList()); }
/** * Find table rule via actual table name. * * @param actualTableName actual table name * @return table rule */ public TableRule FindTableRuleByActualTable(string actualTableName) { return(TableRules.Where(o => o.IsExisted(actualTableName)).FirstOrDefault()); }