Skip to content

Commit 589a7b3

Browse files
Switch UseNPrefixForUnicodeStrings to computed
1 parent 2eaffc4 commit 589a7b3

7 files changed

+10
-7
lines changed

src/NHibernate/Dialect/Dialect.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2087,7 +2087,7 @@ public virtual string ToBooleanValueString(bool value)
20872087
/// <see langword="true" /> if the database needs to have Unicode literals prefixed by <c>N</c>.
20882088
/// </summary>
20892089
/// <remarks><see langword="false" /> by default in the base dialect.</remarks>
2090-
protected virtual bool UseNPrefixForUnicodeStrings { get; set; }
2090+
protected virtual bool UseNPrefixForUnicodeStrings => false;
20912091

20922092
/// <summary>The SQL string literal value to which this database maps string values.</summary>
20932093
/// <param name="value">The string value.</param>

src/NHibernate/Dialect/IngresDialect.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public IngresDialect()
6565
/// <inheritdoc />
6666
/// <remarks><see langword="true" /> by default for Ingres,
6767
/// <see href="https://docs.actian.com/ingres/11.0/index.html#page/SQLRef/String_Literals.htm#ww110572" />.</remarks>
68-
protected override bool UseNPrefixForUnicodeStrings { get; set; } = true;
68+
protected override bool UseNPrefixForUnicodeStrings => true;
6969

7070
#region Overridden informational metadata
7171

src/NHibernate/Dialect/MsSql2000Dialect.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ public override bool SupportsSqlBatches
757757

758758
/// <inheritdoc />
759759
/// <remarks><see langword="true" /> by default for SQL Server.</remarks>
760-
protected override bool UseNPrefixForUnicodeStrings { get; set; } = true;
760+
protected override bool UseNPrefixForUnicodeStrings => true;
761761

762762
#region Overridden informational metadata
763763

src/NHibernate/Dialect/MySQLDialect.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ public override long TimestampResolutionInTicks
538538
/// <inheritdoc />
539539
/// <remarks><see langword="true" /> by default for MySQL,
540540
/// <see href="https://dev.mysql.com/doc/refman/8.0/en/string-literals.html" />.</remarks>
541-
protected override bool UseNPrefixForUnicodeStrings { get; set; } = true;
541+
protected override bool UseNPrefixForUnicodeStrings => true;
542542

543543
#region Overridden informational metadata
544544

src/NHibernate/Dialect/Oracle8iDialect.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ public override void Configure(IDictionary<string, string> settings)
102102

103103
// If changing the default value, keep it in sync with OracleDataClientDriverBase.Configure.
104104
UseNPrefixedTypesForUnicode = PropertiesHelper.GetBoolean(Environment.OracleUseNPrefixedTypesForUnicode, settings, false);
105-
UseNPrefixForUnicodeStrings = UseNPrefixedTypesForUnicode;
106105

107106
RegisterCharacterTypeMappings();
108107
RegisterFloatingPointTypeMappings();
@@ -563,6 +562,10 @@ public override long TimestampResolutionInTicks
563562
/// <inheritdoc />
564563
public override int MaxAliasLength => 30;
565564

565+
/// <inheritdoc />
566+
/// <remarks>Returns the same value as <see cref="UseNPrefixedTypesForUnicode" />.</remarks>
567+
protected override bool UseNPrefixForUnicodeStrings => UseNPrefixedTypesForUnicode;
568+
566569
#region Overridden informational metadata
567570

568571
public override bool SupportsEmptyInList

src/NHibernate/Dialect/SybaseASA9Dialect.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,6 @@ private static int GetAfterSelectInsertPoint(SqlString sql)
197197
/// <inheritdoc />
198198
/// <remarks><see langword="true" /> by default for SQL Anywhere,
199199
/// <see href="https://help.sap.com/docs/SAP_SQL_Anywhere/93079d4ba8e44920ae63ffb4def91f5b/817a2c5f6ce21014aceea962de72126c.html?version=17.0" />.</remarks>
200-
protected override bool UseNPrefixForUnicodeStrings { get; set; } = true;
200+
protected override bool UseNPrefixForUnicodeStrings => true;
201201
}
202202
}

src/NHibernate/Dialect/SybaseSQLAnywhere10Dialect.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,6 @@ public override IDataBaseSchema GetDataBaseSchema(DbConnection connection)
978978
/// <inheritdoc />
979979
/// <remarks><see langword="true" /> by default for SQL Anywhere,
980980
/// <see href="https://help.sap.com/docs/SAP_SQL_Anywhere/93079d4ba8e44920ae63ffb4def91f5b/817a2c5f6ce21014aceea962de72126c.html?version=17.0" />.</remarks>
981-
protected override bool UseNPrefixForUnicodeStrings { get; set; } = true;
981+
protected override bool UseNPrefixForUnicodeStrings => true;
982982
}
983983
}

0 commit comments

Comments
 (0)