private String FormatColumnName() { var formatters = FormatterCollection.GetFormattersFor(this.TableName); string newColumnName = this.Name; foreach (var formatter in formatters) { if (formatter.IsApplicable(this, newColumnName)) { newColumnName = formatter.Apply(this, newColumnName); if (formatter.SkipOtherFormatters(this, newColumnName)) { break; } } } //ensure name is not the same as enclosingType if (this.Table.CLRTypeName == newColumnName) { newColumnName = newColumnName + "_" + newColumnName; } //if te name is a foreign key ref, add suffix _Key if (this.IsForeignKey) { newColumnName = newColumnName + "_Key"; } return(newColumnName); }
public string FormatTableName() { var formatters = FormatterCollection.GetFormattersFor(this.Name); string newTableName = this.Name; foreach (var formatter in formatters) { if (formatter.IsApplicable(this, newTableName)) { newTableName = formatter.Apply(this, newTableName); if (formatter.SkipOtherFormatters(this, newTableName)) { break; } } } //Todo change the Info thing with sthg else. basically it is used to check duplicates return(newTableName + Info); }