Skip to content

Commit

Permalink
Introduce IReadOnlyIndex.DisplayName
Browse files Browse the repository at this point in the history
  • Loading branch information
roji committed Jan 21, 2022
1 parent 8360e9e commit acd885d
Show file tree
Hide file tree
Showing 12 changed files with 86 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ public static bool AreCompatible(
{
throw new InvalidOperationException(
RelationalStrings.DuplicateIndexTableMismatch(
index.Properties.Format(),
index.DisplayName(),
index.DeclaringEntityType.DisplayName(),
duplicateIndex.Properties.Format(),
duplicateIndex.DisplayName(),
duplicateIndex.DeclaringEntityType.DisplayName(),
index.GetDatabaseName(storeObject),
index.DeclaringEntityType.GetSchemaQualifiedTableName(),
Expand All @@ -50,9 +50,9 @@ public static bool AreCompatible(
{
throw new InvalidOperationException(
RelationalStrings.DuplicateIndexColumnMismatch(
index.Properties.Format(),
index.DisplayName(),
index.DeclaringEntityType.DisplayName(),
duplicateIndex.Properties.Format(),
duplicateIndex.DisplayName(),
duplicateIndex.DeclaringEntityType.DisplayName(),
index.DeclaringEntityType.GetSchemaQualifiedTableName(),
index.GetDatabaseName(storeObject),
Expand All @@ -69,9 +69,9 @@ public static bool AreCompatible(
{
throw new InvalidOperationException(
RelationalStrings.DuplicateIndexUniquenessMismatch(
index.Properties.Format(),
index.DisplayName(),
index.DeclaringEntityType.DisplayName(),
duplicateIndex.Properties.Format(),
duplicateIndex.DisplayName(),
duplicateIndex.DeclaringEntityType.DisplayName(),
index.DeclaringEntityType.GetSchemaQualifiedTableName(),
index.GetDatabaseName(storeObject)));
Expand All @@ -89,9 +89,9 @@ public static bool AreCompatible(
{
throw new InvalidOperationException(
RelationalStrings.DuplicateIndexSortOrdersMismatch(
index.Properties.Format(),
index.DisplayName(),
index.DeclaringEntityType.DisplayName(),
duplicateIndex.Properties.Format(),
duplicateIndex.DisplayName(),
duplicateIndex.DeclaringEntityType.DisplayName(),
index.DeclaringEntityType.GetSchemaQualifiedTableName(),
index.GetDatabaseName(storeObject)));
Expand All @@ -106,9 +106,9 @@ public static bool AreCompatible(
{
throw new InvalidOperationException(
RelationalStrings.DuplicateIndexFiltersMismatch(
index.Properties.Format(),
index.DisplayName(),
index.DeclaringEntityType.DisplayName(),
duplicateIndex.Properties.Format(),
duplicateIndex.DisplayName(),
duplicateIndex.DeclaringEntityType.DisplayName(),
index.DeclaringEntityType.GetSchemaQualifiedTableName(),
index.GetDatabaseName(storeObject),
Expand Down
40 changes: 20 additions & 20 deletions src/EFCore.Relational/Properties/RelationalStrings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/EFCore.Relational/Properties/RelationalStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -293,19 +293,19 @@
<value>The foreign keys {foreignKeyProperties1} on '{entityType1}' and {foreignKeyProperties2} on '{entityType2}' are both mapped to '{table}.{foreignKeyName}', but with different uniqueness configurations.</value>
</data>
<data name="DuplicateIndexColumnMismatch" xml:space="preserve">
<value>The indexes {indexProperties1} on '{entityType1}' and {indexProperties2} on '{entityType2}' are both mapped to '{table}.{indexName}', but with different columns ({columnNames1} and {columnNames2}).</value>
<value>The indexes {index1} on '{entityType1}' and {index2} on '{entityType2}' are both mapped to '{table}.{indexName}', but with different columns ({columnNames1} and {columnNames2}).</value>
</data>
<data name="DuplicateIndexFiltersMismatch" xml:space="preserve">
<value>The indexes {indexProperties1} on '{entityType1}' and {indexProperties2} on '{entityType2}' are both mapped to '{table}.{indexName}', but with different filters ('{filter1}' and '{filter2}').</value>
<value>The indexes {index1} on '{entityType1}' and {index2} on '{entityType2}' are both mapped to '{table}.{indexName}', but with different filters ('{filter1}' and '{filter2}').</value>
</data>
<data name="DuplicateIndexSortOrdersMismatch" xml:space="preserve">
<value>The indexes {indexProperties1} on '{entityType1}' and {indexProperties2} on '{entityType2}' are both mapped to '{table}.{indexName}', but with different sort orders.</value>
<value>The indexes {index1} on '{entityType1}' and {index2} on '{entityType2}' are both mapped to '{table}.{indexName}', but with different sort orders.</value>
</data>
<data name="DuplicateIndexTableMismatch" xml:space="preserve">
<value>The indexes {indexProperties1} on '{entityType1}' and {indexProperties2} on '{entityType2}' are both mapped to '{indexName}', but are declared on different tables ('{table1}' and '{table2}').</value>
<value>The indexes {index1} on '{entityType1}' and {index2} on '{entityType2}' are both mapped to '{indexName}', but are declared on different tables ('{table1}' and '{table2}').</value>
</data>
<data name="DuplicateIndexUniquenessMismatch" xml:space="preserve">
<value>The indexes {indexProperties1} on '{entityType1}' and {indexProperties2} on '{entityType2}' are both mapped to '{table}.{indexName}', but with different uniqueness configurations.</value>
<value>The indexes {index1} on '{entityType1}' and {index2} on '{entityType2}' are both mapped to '{table}.{indexName}', but with different uniqueness configurations.</value>
</data>
<data name="DuplicateKeyColumnMismatch" xml:space="preserve">
<value>The keys {keyProperties1} on '{entityType1}' and {keyProperties2} on '{entityType2}' are both mapped to '{table}.{keyName}', but with different columns ({columnNames1} and {columnNames2}).</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ protected virtual void ValidateIndexIncludeProperties(
throw new InvalidOperationException(
SqlServerStrings.IncludePropertyNotFound(
notFound,
index.Name == null ? index.Properties.Format() : "'" + index.Name + "'",
index.DisplayName(),
index.DeclaringEntityType.DisplayName()));
}

Expand All @@ -179,7 +179,7 @@ protected virtual void ValidateIndexIncludeProperties(
SqlServerStrings.IncludePropertyDuplicated(
index.DeclaringEntityType.DisplayName(),
duplicateProperty,
index.Name == null ? index.Properties.Format() : "'" + index.Name + "'"));
index.DisplayName()));
}

var coveredProperty = includeProperties
Expand All @@ -191,7 +191,7 @@ protected virtual void ValidateIndexIncludeProperties(
SqlServerStrings.IncludePropertyInIndex(
index.DeclaringEntityType.DisplayName(),
coveredProperty,
index.Name == null ? index.Properties.Format() : "'" + index.Name + "'"));
index.DisplayName()));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public static bool AreCompatibleForSqlServer(
{
throw new InvalidOperationException(
SqlServerStrings.DuplicateIndexIncludedMismatch(
index.Properties.Format(),
index.DisplayName(),
index.DeclaringEntityType.DisplayName(),
duplicateIndex.Properties.Format(),
duplicateIndex.DisplayName(),
duplicateIndex.DeclaringEntityType.DisplayName(),
index.DeclaringEntityType.GetSchemaQualifiedTableName(),
index.GetDatabaseName(storeObject),
Expand All @@ -55,9 +55,9 @@ public static bool AreCompatibleForSqlServer(
{
throw new InvalidOperationException(
SqlServerStrings.DuplicateIndexOnlineMismatch(
index.Properties.Format(),
index.DisplayName(),
index.DeclaringEntityType.DisplayName(),
duplicateIndex.Properties.Format(),
duplicateIndex.DisplayName(),
duplicateIndex.DeclaringEntityType.DisplayName(),
index.DeclaringEntityType.GetSchemaQualifiedTableName(),
index.GetDatabaseName(storeObject)));
Expand All @@ -72,9 +72,9 @@ public static bool AreCompatibleForSqlServer(
{
throw new InvalidOperationException(
SqlServerStrings.DuplicateIndexClusteredMismatch(
index.Properties.Format(),
index.DisplayName(),
index.DeclaringEntityType.DisplayName(),
duplicateIndex.Properties.Format(),
duplicateIndex.DisplayName(),
duplicateIndex.DeclaringEntityType.DisplayName(),
index.DeclaringEntityType.GetSchemaQualifiedTableName(),
index.GetDatabaseName(storeObject)));
Expand All @@ -89,9 +89,9 @@ public static bool AreCompatibleForSqlServer(
{
throw new InvalidOperationException(
SqlServerStrings.DuplicateIndexFillFactorMismatch(
index.Properties.Format(),
index.DisplayName(),
index.DeclaringEntityType.DisplayName(),
duplicateIndex.Properties.Format(),
duplicateIndex.DisplayName(),
duplicateIndex.DeclaringEntityType.DisplayName(),
index.DeclaringEntityType.GetSchemaQualifiedTableName(),
index.GetDatabaseName(storeObject)));
Expand Down
Loading

0 comments on commit acd885d

Please sign in to comment.