/// <summary> /// Searches for an tgColumnMetadata by the propery name. /// </summary> /// <param name="propertyName">The high level PropertyName, for example, Employees.PropertyNames.LastName</param> /// <returns>The tgColumnMetadata or null if not found.</returns> public tgColumnMetadata FindByPropertyName(string propertyName) { tgColumnMetadata col = null; if (this.hashByPropertyName.ContainsKey(propertyName)) { col = this.hashByPropertyName[propertyName]; } return(col); }
/// <summary> /// Used internally by Tiraggo. This should never be called by user code /// </summary> /// <param name="column">The new tgColumnMetadata to add to the array</param> public void Add(tgColumnMetadata column) { list.Add(column); hashByColumnName[column.Name] = column; hashByPropertyName[column.PropertyName] = column; if (column.IsInPrimaryKey) { this.primaryKeys.Add(column); } }
/// <summary> /// Searches for an tgColumnMetadata by the propery name. This method is the same as /// using the indexer. /// </summary> /// <param name="columnName">The high level PropertyName, for example, Employees.ColumnNames.LastName</param> /// <returns>The tgColumnMetadata or null if not found.</returns> public tgColumnMetadata FindByColumnName(string columnName) { tgColumnMetadata col = null; if (this.hashByColumnName.ContainsKey(columnName)) { col = this.hashByColumnName[columnName]; } return(col); }
/// <summary> /// Provides direct access into the collection by column name. /// </summary> /// <param name="columnName">The name of the desired column. This parameter is expected /// to be the physical name of the column as in the table or view, for example, /// Employees.ColumnNames.LastName</param> /// <returns></returns> public tgColumnMetadata this[System.String columnName] { get { tgColumnMetadata col = null; if (this.hashByColumnName.ContainsKey(columnName)) { col = this.hashByColumnName[columnName]; } return(col); } }