public override string GetParameterName(PropertyInfo propInfo, string columnName, string parameterName, bool doNotTranslate = false, DbKeyConstraint constraint = DbKeyConstraint.None) { if (string.IsNullOrEmpty(parameterName)) { parameterName = (doNotTranslate ? string.Empty : "p_") + (columnName ?? propInfo.Name); } return(base.GetParameterName(null, null, parameterName, doNotTranslate, constraint)); }
/// <summary> /// Translates a name. /// </summary> protected virtual string TranslateName(Source source, Translation scope, string reflectionName, string configurationName, Case namingCase, DbKeyConstraint constraint, AffixPlacing idPlacing, params string[] affixes) { bool forceId; switch (constraint) { case DbKeyConstraint.PrimaryKey: case DbKeyConstraint.PrimaryForeignKey: case DbKeyConstraint.ForeignKey: forceId = scope != Translation.None && ForceIdOnKeyColumn; break; default: forceId = false; break; } return(TranslateName(source, scope, reflectionName, configurationName, namingCase, forceId, idPlacing, affixes)); }
/// <summary> /// Gets a field name. /// </summary> public virtual string GetFieldName(PropertyInfo propInfo, string fieldName, DbKeyConstraint constraint = DbKeyConstraint.None) { return(TranslateName(TextSource, Scope, propInfo?.Name, fieldName, FieldsCase, constraint, IdPlacing, IdText)); }
/// <summary> /// Gets a table column name. /// </summary> public virtual string GetColumnName(string tableName, PropertyInfo propInfo, string columnName, DbKeyConstraint constraint = DbKeyConstraint.None) { return(TranslateName(TextSource, Scope, propInfo.Name, columnName, FieldsCase, constraint, IdPlacing, IdText)); }
/// <summary> /// Gets a parameter name. /// </summary> public virtual string GetParameterName(PropertyInfo propInfo, string columnName, string parameterName, bool doNotTranslate = false, DbKeyConstraint constraint = DbKeyConstraint.None) { return(TranslateName(TextSource, doNotTranslate ? Translation.None : Scope, propInfo?.Name, parameterName ?? columnName, ParametersCase, constraint, IdPlacing, IdText)); }