diff --git a/EFCore.sln b/EFCore.sln index e85efa72e6..e0056d3717 100644 --- a/EFCore.sln +++ b/EFCore.sln @@ -15,8 +15,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.Relational", "src\EF EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.Sqlite.Core", "src\EFCore.Sqlite.Core\EFCore.Sqlite.Core.csproj", "{A257C01B-BB91-44BA-831C-1E04F7800AC8}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.Relational.Design", "src\EFCore.Relational.Design\EFCore.Relational.Design.csproj", "{1942C281-C12B-4818-8CC8-C42842871FF5}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.SqlServer", "src\EFCore.SqlServer\EFCore.SqlServer.csproj", "{99595B81-D47C-40BA-8C61-5328A5A0E4AB}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.CrossStore.FunctionalTests", "test\EFCore.CrossStore.FunctionalTests\EFCore.CrossStore.FunctionalTests.csproj", "{7EAC2B8E-4AF6-40D2-95C0-A6662762A7E0}" @@ -25,8 +23,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.InMemory.FunctionalT EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.InMemory.Tests", "test\EFCore.InMemory.Tests\EFCore.InMemory.Tests.csproj", "{AB8D4BD7-8AB6-4004-AF21-32790EED93BC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.Relational.Design.Tests", "test\EFCore.Relational.Design.Tests\EFCore.Relational.Design.Tests.csproj", "{47DCCE35-C7FD-4E53-A0F9-BB8A7226978C}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.Relational.Tests", "test\EFCore.Relational.Tests\EFCore.Relational.Tests.csproj", "{1A884122-DC9E-42B1-8821-E43340F954D1}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCore.Sqlite.Design.FunctionalTests", "test\EFCore.Sqlite.Design.FunctionalTests\EFCore.Sqlite.Design.FunctionalTests.csproj", "{2A62F6C9-B7F3-443B-A253-931D38879A9C}" @@ -99,10 +95,6 @@ Global {A257C01B-BB91-44BA-831C-1E04F7800AC8}.Debug|Any CPU.Build.0 = Debug|Any CPU {A257C01B-BB91-44BA-831C-1E04F7800AC8}.Release|Any CPU.ActiveCfg = Release|Any CPU {A257C01B-BB91-44BA-831C-1E04F7800AC8}.Release|Any CPU.Build.0 = Release|Any CPU - {1942C281-C12B-4818-8CC8-C42842871FF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1942C281-C12B-4818-8CC8-C42842871FF5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1942C281-C12B-4818-8CC8-C42842871FF5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1942C281-C12B-4818-8CC8-C42842871FF5}.Release|Any CPU.Build.0 = Release|Any CPU {99595B81-D47C-40BA-8C61-5328A5A0E4AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {99595B81-D47C-40BA-8C61-5328A5A0E4AB}.Debug|Any CPU.Build.0 = Debug|Any CPU {99595B81-D47C-40BA-8C61-5328A5A0E4AB}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -119,10 +111,6 @@ Global {AB8D4BD7-8AB6-4004-AF21-32790EED93BC}.Debug|Any CPU.Build.0 = Debug|Any CPU {AB8D4BD7-8AB6-4004-AF21-32790EED93BC}.Release|Any CPU.ActiveCfg = Release|Any CPU {AB8D4BD7-8AB6-4004-AF21-32790EED93BC}.Release|Any CPU.Build.0 = Release|Any CPU - {47DCCE35-C7FD-4E53-A0F9-BB8A7226978C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {47DCCE35-C7FD-4E53-A0F9-BB8A7226978C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {47DCCE35-C7FD-4E53-A0F9-BB8A7226978C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {47DCCE35-C7FD-4E53-A0F9-BB8A7226978C}.Release|Any CPU.Build.0 = Release|Any CPU {1A884122-DC9E-42B1-8821-E43340F954D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1A884122-DC9E-42B1-8821-E43340F954D1}.Debug|Any CPU.Build.0 = Debug|Any CPU {1A884122-DC9E-42B1-8821-E43340F954D1}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -232,12 +220,10 @@ Global {6B102CC4-4396-4A7B-9F72-2C6B5C4D8310} = {CE6B50B2-34AE-44C9-940A-4E48C3E1B3BC} {6A25DF99-2615-46D8-9532-821764647EE1} = {CE6B50B2-34AE-44C9-940A-4E48C3E1B3BC} {A257C01B-BB91-44BA-831C-1E04F7800AC8} = {CE6B50B2-34AE-44C9-940A-4E48C3E1B3BC} - {1942C281-C12B-4818-8CC8-C42842871FF5} = {CE6B50B2-34AE-44C9-940A-4E48C3E1B3BC} {99595B81-D47C-40BA-8C61-5328A5A0E4AB} = {CE6B50B2-34AE-44C9-940A-4E48C3E1B3BC} {7EAC2B8E-4AF6-40D2-95C0-A6662762A7E0} = {258D5057-81B9-40EC-A872-D21E27452749} {305B30D3-0E30-46E9-BA9D-060E0B79BE98} = {258D5057-81B9-40EC-A872-D21E27452749} {AB8D4BD7-8AB6-4004-AF21-32790EED93BC} = {258D5057-81B9-40EC-A872-D21E27452749} - {47DCCE35-C7FD-4E53-A0F9-BB8A7226978C} = {258D5057-81B9-40EC-A872-D21E27452749} {1A884122-DC9E-42B1-8821-E43340F954D1} = {258D5057-81B9-40EC-A872-D21E27452749} {2A62F6C9-B7F3-443B-A253-931D38879A9C} = {258D5057-81B9-40EC-A872-D21E27452749} {7BB7D051-56D7-4A40-A29E-3801F5C19239} = {258D5057-81B9-40EC-A872-D21E27452749} diff --git a/src/EFCore.Design/Diagnostics/DesignEventId.cs b/src/EFCore.Design/Diagnostics/DesignEventId.cs new file mode 100644 index 0000000000..f4bc2c0dcc --- /dev/null +++ b/src/EFCore.Design/Diagnostics/DesignEventId.cs @@ -0,0 +1,95 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Diagnostics; +using Microsoft.Extensions.Logging; + +namespace Microsoft.EntityFrameworkCore.Diagnostics +{ + /// + /// + /// Event IDs for design events that correspond to messages logged to an + /// and events sent to a . + /// + /// + /// These IDs are also used with to configure the + /// behavior of warnings. + /// + /// + public static class DesignEventId + { + // Warning: These values must not change between releases. + // Only add new values to the end of sections, never in the middle. + // Try to use naming and be consistent with existing names. + private enum Id + { + // Scaffolding warning events + MissingSchemaWarning = CoreEventId.CoreDesignBaseId, + SequenceTypeNotSupportedWarning, + UnableToGenerateEntityTypeWarning, + ColumnTypeNotMappedWarning, + MissingPrimaryKeyWarning, + PrimaryKeyColumnsNotMappedWarning, + ForeignKeyReferencesNotMappedTableWarning, + ForeignKeyReferencesMissingPrincipalKeyWarning, + ForeignKeyPrincipalEndContainsNullableColumnsWarning + } + + private static readonly string _scaffoldingPrefix = DbLoggerCategory.Scaffolding.Name + "."; + private static EventId MakeScaffoldingId(Id id) => new EventId((int)id, _scaffoldingPrefix + id); + + /// + /// The database is missing a schema. + /// This event is in the category. + /// + public static readonly EventId MissingSchemaWarning = MakeScaffoldingId(Id.MissingSchemaWarning); + + /// + /// The database has a sequence of a type that is not supported. + /// This event is in the category. + /// + public static readonly EventId SequenceTypeNotSupportedWarning = MakeScaffoldingId(Id.SequenceTypeNotSupportedWarning); + + /// + /// An entity type could not be generated. + /// This event is in the category. + /// + public static readonly EventId UnableToGenerateEntityTypeWarning = MakeScaffoldingId(Id.UnableToGenerateEntityTypeWarning); + + /// + /// A column type could not be mapped. + /// This event is in the category. + /// + public static readonly EventId ColumnTypeNotMappedWarning = MakeScaffoldingId(Id.ColumnTypeNotMappedWarning); + + /// + /// A table is missing a primary key. + /// This event is in the category. + /// + public static readonly EventId MissingPrimaryKeyWarning = MakeScaffoldingId(Id.MissingPrimaryKeyWarning); + + /// + /// Columns in a primary key were not mapped. + /// This event is in the category. + /// + public static readonly EventId PrimaryKeyColumnsNotMappedWarning = MakeScaffoldingId(Id.PrimaryKeyColumnsNotMappedWarning); + + /// + /// A foreign key references a table that was not mapped. + /// This event is in the category. + /// + public static readonly EventId ForeignKeyReferencesNotMappedTableWarning = MakeScaffoldingId(Id.ForeignKeyReferencesNotMappedTableWarning); + + /// + /// A foreign key references missing prinicpal key columns. + /// This event is in the category. + /// + public static readonly EventId ForeignKeyReferencesMissingPrincipalKeyWarning = MakeScaffoldingId(Id.ForeignKeyReferencesMissingPrincipalKeyWarning); + + /// + /// A principal key contains nullable columns. + /// This event is in the category. + /// + public static readonly EventId ForeignKeyPrincipalEndContainsNullableColumnsWarning = MakeScaffoldingId(Id.ForeignKeyPrincipalEndContainsNullableColumnsWarning); + } +} diff --git a/src/EFCore.Design/EFCore.Design.csproj b/src/EFCore.Design/EFCore.Design.csproj index 0241ae653d..1467a5c20f 100644 --- a/src/EFCore.Design/EFCore.Design.csproj +++ b/src/EFCore.Design/EFCore.Design.csproj @@ -17,7 +17,7 @@ - + diff --git a/src/EFCore.Relational.Design/Infrastructure/IPluralizer.cs b/src/EFCore.Design/Infrastructure/IPluralizer.cs similarity index 100% rename from src/EFCore.Relational.Design/Infrastructure/IPluralizer.cs rename to src/EFCore.Design/Infrastructure/IPluralizer.cs diff --git a/src/EFCore.Design/Internal/DesignLoggerExtensions.cs b/src/EFCore.Design/Internal/DesignLoggerExtensions.cs new file mode 100644 index 0000000000..427be3ef21 --- /dev/null +++ b/src/EFCore.Design/Internal/DesignLoggerExtensions.cs @@ -0,0 +1,258 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using JetBrains.Annotations; +using Microsoft.EntityFrameworkCore.Diagnostics; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations.Design; +using Microsoft.EntityFrameworkCore.Migrations.Internal; +using Microsoft.EntityFrameworkCore.Migrations.Operations; + +namespace Microsoft.EntityFrameworkCore.Internal +{ + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static class DesignLoggerExtensions + { + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void MissingSchemaWarning( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string schemaName) + { + var definition = DesignStrings.LogMissingSchema; + + definition.Log(diagnostics, schemaName); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + SchemaName = schemaName + }); + } + } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void SequenceTypeNotSupportedWarning( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string sequenceName, + [CanBeNull] string dataTypeName) + { + var definition = DesignStrings.LogBadSequenceType; + + definition.Log(diagnostics, sequenceName, dataTypeName); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + SequenceName = sequenceName, + DataTypeName = dataTypeName + }); + } + } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void UnableToGenerateEntityTypeWarning( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string tableName) + { + var definition = DesignStrings.LogUnableToGenerateEntityType; + + definition.Log(diagnostics, tableName); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + TableName = tableName + }); + } + } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void ColumnTypeNotMappedWarning( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string columnName, + [CanBeNull] string dataTypeName) + { + var definition = DesignStrings.LogCannotFindTypeMappingForColumn; + + definition.Log(diagnostics, columnName, dataTypeName); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + ColumnName = columnName, + DataTypeName = dataTypeName + }); + } + } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void MissingPrimaryKeyWarning( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string tableName) + { + var definition = DesignStrings.LogMissingPrimaryKey; + + definition.Log(diagnostics, tableName); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + TableName = tableName + }); + } + } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void PrimaryKeyColumnsNotMappedWarning( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string tableName, + [NotNull] IList unmappedColumnNames) + { + var definition = DesignStrings.LogPrimaryKeyErrorPropertyNotFound; + + definition.Log( + diagnostics, + tableName, + string.Join(CultureInfo.CurrentCulture.TextInfo.ListSeparator, unmappedColumnNames)); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + TableName = tableName, + UnmappedColumnNames = unmappedColumnNames + }); + } + } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void ForeignKeyReferencesNotMappedTableWarning( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string foreignKeyName, + [NotNull] string principalTableName) + { + var definition = DesignStrings.LogForeignKeyScaffoldErrorPrincipalTableScaffoldingError; + + definition.Log(diagnostics, foreignKeyName, principalTableName); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + ForeignKeyName = foreignKeyName, + PrincipalTableName = principalTableName + }); + } + } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void ForeignKeyReferencesMissingPrincipalKeyWarning( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string foreignKeyName, + [CanBeNull] string principalEntityTypeName, + [NotNull] IList principalColumnNames) + { + var definition = DesignStrings.LogForeignKeyScaffoldErrorPrincipalKeyNotFound; + + definition.Log( + diagnostics, + foreignKeyName, + string.Join(CultureInfo.CurrentCulture.TextInfo.ListSeparator, principalColumnNames), + principalEntityTypeName); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + ForeignKeyName = foreignKeyName, + PrincipalEntityTypeName = principalEntityTypeName, + PrincipalColumnNames = principalColumnNames + }); + } + } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void ForeignKeyPrincipalEndContainsNullableColumnsWarning( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string foreignKeyName, + [CanBeNull] string indexName, + [CanBeNull] IList nullablePropertyNames) + { + var definition = DesignStrings.LogForeignKeyPrincipalEndContainsNullableColumns; + + definition.Log( + diagnostics, + foreignKeyName, + indexName, + nullablePropertyNames.Aggregate((a, b) => a + "," + b)); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + ForeignKeyName = foreignKeyName, + IndexName = indexName, + NullablePropertyNames = nullablePropertyNames + }); + } + } + } +} diff --git a/src/EFCore.Design/Properties/DesignStrings.Designer.cs b/src/EFCore.Design/Properties/DesignStrings.Designer.cs index 64f6bb4d17..545cfc7313 100644 --- a/src/EFCore.Design/Properties/DesignStrings.Designer.cs +++ b/src/EFCore.Design/Properties/DesignStrings.Designer.cs @@ -460,6 +460,138 @@ namespace Microsoft.EntityFrameworkCore.Internal GetString("FoundContextFactory", nameof(factory)), factory); + /// + /// Metadata model returned should not be null. Provider: {providerTypeName}. + /// + public static string ProviderReturnedNullModel([CanBeNull] object providerTypeName) + => string.Format( + GetString("ProviderReturnedNullModel", nameof(providerTypeName)), + providerTypeName); + + /// + /// No files generated in directory {outputDirectoryName}. The following file(s) already exist and must be made writeable to continue: {readOnlyFiles}. + /// + public static string ReadOnlyFiles([CanBeNull] object outputDirectoryName, [CanBeNull] object readOnlyFiles) + => string.Format( + GetString("ReadOnlyFiles", nameof(outputDirectoryName), nameof(readOnlyFiles)), + outputDirectoryName, readOnlyFiles); + + /// + /// The following file(s) already exist in directory {outputDirectoryName}: {existingFiles}. Use the Force flag to overwrite these files. + /// + public static string ExistingFiles([CanBeNull] object outputDirectoryName, [CanBeNull] object existingFiles) + => string.Format( + GetString("ExistingFiles", nameof(outputDirectoryName), nameof(existingFiles)), + outputDirectoryName, existingFiles); + + /// + /// Could not find type mapping for column '{columnName}' with data type '{dateType}'. Skipping column. + /// + public static readonly EventDefinition LogCannotFindTypeMappingForColumn + = new EventDefinition( + DesignEventId.ColumnTypeNotMappedWarning, + LogLevel.Warning, + LoggerMessage.Define( + LogLevel.Warning, + DesignEventId.ColumnTypeNotMappedWarning, + _resourceManager.GetString("LogCannotFindTypeMappingForColumn"))); + + /// + /// Could not scaffold the foreign key '{foreignKeyName}'. A key for '{columnsList}' was not found in the principal entity type '{principalEntityType}'. + /// + public static readonly EventDefinition LogForeignKeyScaffoldErrorPrincipalKeyNotFound + = new EventDefinition( + DesignEventId.ForeignKeyReferencesMissingPrincipalKeyWarning, + LogLevel.Warning, + LoggerMessage.Define( + LogLevel.Warning, + DesignEventId.ForeignKeyReferencesMissingPrincipalKeyWarning, + _resourceManager.GetString("LogForeignKeyScaffoldErrorPrincipalKeyNotFound"))); + + /// + /// Could not scaffold the foreign key '{foreignKeyName}'. The referenced table '{principaltableName}' could not be scaffolded. + /// + public static readonly EventDefinition LogForeignKeyScaffoldErrorPrincipalTableScaffoldingError + = new EventDefinition( + DesignEventId.ForeignKeyReferencesNotMappedTableWarning, + LogLevel.Warning, + LoggerMessage.Define( + LogLevel.Warning, + DesignEventId.ForeignKeyReferencesNotMappedTableWarning, + _resourceManager.GetString("LogForeignKeyScaffoldErrorPrincipalTableScaffoldingError"))); + + /// + /// Could not scaffold the primary key for '{tableName}'. The following columns in the primary key could not be scaffolded: {columnNames}. + /// + public static readonly EventDefinition LogPrimaryKeyErrorPropertyNotFound + = new EventDefinition( + DesignEventId.PrimaryKeyColumnsNotMappedWarning, + LogLevel.Warning, + LoggerMessage.Define( + LogLevel.Warning, + DesignEventId.PrimaryKeyColumnsNotMappedWarning, + _resourceManager.GetString("LogPrimaryKeyErrorPropertyNotFound"))); + + /// + /// Unable to identify the primary key for table '{tableName}'. + /// + public static readonly EventDefinition LogMissingPrimaryKey + = new EventDefinition( + DesignEventId.MissingPrimaryKeyWarning, + LogLevel.Warning, + LoggerMessage.Define( + LogLevel.Warning, + DesignEventId.MissingPrimaryKeyWarning, + _resourceManager.GetString("LogMissingPrimaryKey"))); + + /// + /// Unable to generate entity type for table '{tableName}'. + /// + public static readonly EventDefinition LogUnableToGenerateEntityType + = new EventDefinition( + DesignEventId.UnableToGenerateEntityTypeWarning, + LogLevel.Warning, + LoggerMessage.Define( + LogLevel.Warning, + DesignEventId.UnableToGenerateEntityTypeWarning, + _resourceManager.GetString("LogUnableToGenerateEntityType"))); + + /// + /// For sequence '{sequenceName}'. Unable to scaffold because it uses an unsupported type: '{typeName}'. + /// + public static readonly EventDefinition LogBadSequenceType + = new EventDefinition( + DesignEventId.SequenceTypeNotSupportedWarning, + LogLevel.Warning, + LoggerMessage.Define( + LogLevel.Warning, + DesignEventId.SequenceTypeNotSupportedWarning, + _resourceManager.GetString("LogBadSequenceType"))); + + /// + /// Unable to find a schema in the database matching the selected schema {schema}. + /// + public static readonly EventDefinition LogMissingSchema + = new EventDefinition( + DesignEventId.MissingSchemaWarning, + LogLevel.Warning, + LoggerMessage.Define( + LogLevel.Warning, + DesignEventId.MissingSchemaWarning, + _resourceManager.GetString("LogMissingSchema"))); + + /// + /// The principal end of the foreign key '{foreignKeyName}' is supported by the unique index '{indexName}' and contains the following nullable columns '{columnNames}'. Entity Framework requires the properties representing those columns to be non-nullable. + /// + public static readonly EventDefinition LogForeignKeyPrincipalEndContainsNullableColumns + = new EventDefinition( + DesignEventId.ForeignKeyPrincipalEndContainsNullableColumnsWarning, + LogLevel.Warning, + LoggerMessage.Define( + LogLevel.Warning, + DesignEventId.ForeignKeyPrincipalEndContainsNullableColumnsWarning, + _resourceManager.GetString("LogForeignKeyPrincipalEndContainsNullableColumns"))); + private static string GetString(string name, params string[] formatterNames) { var value = _resourceManager.GetString(name); diff --git a/src/EFCore.Design/Properties/DesignStrings.resx b/src/EFCore.Design/Properties/DesignStrings.resx index 14cca28a49..cb67956ae3 100644 --- a/src/EFCore.Design/Properties/DesignStrings.resx +++ b/src/EFCore.Design/Properties/DesignStrings.resx @@ -297,4 +297,49 @@ Change your target project to the migrations project by using the Package Manage Found IDesignTimeDbContextFactory implementation '{factory}'. + + Metadata model returned should not be null. Provider: {providerTypeName}. + + + No files generated in directory {outputDirectoryName}. The following file(s) already exist and must be made writeable to continue: {readOnlyFiles}. + + + The following file(s) already exist in directory {outputDirectoryName}: {existingFiles}. Use the Force flag to overwrite these files. + + + Could not find type mapping for column '{columnName}' with data type '{dateType}'. Skipping column. + Warning DesignEventId.ColumnTypeNotMappedWarning string string + + + Could not scaffold the foreign key '{foreignKeyName}'. A key for '{columnsList}' was not found in the principal entity type '{principalEntityType}'. + Warning DesignEventId.ForeignKeyReferencesMissingPrincipalKeyWarning string string string + + + Could not scaffold the foreign key '{foreignKeyName}'. The referenced table '{principaltableName}' could not be scaffolded. + Warning DesignEventId.ForeignKeyReferencesNotMappedTableWarning string string + + + Could not scaffold the primary key for '{tableName}'. The following columns in the primary key could not be scaffolded: {columnNames}. + Warning DesignEventId.PrimaryKeyColumnsNotMappedWarning string string + + + Unable to identify the primary key for table '{tableName}'. + Warning DesignEventId.MissingPrimaryKeyWarning string + + + Unable to generate entity type for table '{tableName}'. + Warning DesignEventId.UnableToGenerateEntityTypeWarning string + + + For sequence '{sequenceName}'. Unable to scaffold because it uses an unsupported type: '{typeName}'. + Warning DesignEventId.SequenceTypeNotSupportedWarning string string + + + Unable to find a schema in the database matching the selected schema {schema}. + Warning DesignEventId.MissingSchemaWarning string + + + The principal end of the foreign key '{foreignKeyName}' is supported by the unique index '{indexName}' and contains the following nullable columns '{columnNames}'. Entity Framework requires the properties representing those columns to be non-nullable. + Warning DesignEventId.ForeignKeyPrincipalEndContainsNullableColumnsWarning string string string + \ No newline at end of file diff --git a/src/EFCore.Relational.Design/Internal/CSharpNamer.cs b/src/EFCore.Design/Scaffolding/Internal/CSharpNamer.cs similarity index 100% rename from src/EFCore.Relational.Design/Internal/CSharpNamer.cs rename to src/EFCore.Design/Scaffolding/Internal/CSharpNamer.cs diff --git a/src/EFCore.Relational.Design/Internal/CSharpUniqueNamer.cs b/src/EFCore.Design/Scaffolding/Internal/CSharpUniqueNamer.cs similarity index 100% rename from src/EFCore.Relational.Design/Internal/CSharpUniqueNamer.cs rename to src/EFCore.Design/Scaffolding/Internal/CSharpUniqueNamer.cs diff --git a/src/EFCore.Relational.Design/Internal/CSharpUtilities.cs b/src/EFCore.Design/Scaffolding/Internal/CSharpUtilities.cs similarity index 100% rename from src/EFCore.Relational.Design/Internal/CSharpUtilities.cs rename to src/EFCore.Design/Scaffolding/Internal/CSharpUtilities.cs diff --git a/src/EFCore.Relational.Design/Internal/CandidateNamingService.cs b/src/EFCore.Design/Scaffolding/Internal/CandidateNamingService.cs similarity index 100% rename from src/EFCore.Relational.Design/Internal/CandidateNamingService.cs rename to src/EFCore.Design/Scaffolding/Internal/CandidateNamingService.cs diff --git a/src/EFCore.Relational.Design/IScaffoldingModelFactory.cs b/src/EFCore.Design/Scaffolding/Internal/IScaffoldingModelFactory.cs similarity index 100% rename from src/EFCore.Relational.Design/IScaffoldingModelFactory.cs rename to src/EFCore.Design/Scaffolding/Internal/IScaffoldingModelFactory.cs diff --git a/src/EFCore.Design/Scaffolding/Internal/ModelScaffolder.cs b/src/EFCore.Design/Scaffolding/Internal/ModelScaffolder.cs index a362b3c331..34bb94b7ca 100644 --- a/src/EFCore.Design/Scaffolding/Internal/ModelScaffolder.cs +++ b/src/EFCore.Design/Scaffolding/Internal/ModelScaffolder.cs @@ -84,7 +84,7 @@ namespace Microsoft.EntityFrameworkCore.Scaffolding.Internal if (model == null) { throw new InvalidOperationException( - RelationalDesignStrings.ProviderReturnedNullModel( + DesignStrings.ProviderReturnedNullModel( _factory.GetType().ShortDisplayName())); } @@ -138,7 +138,7 @@ namespace Microsoft.EntityFrameworkCore.Scaffolding.Internal if (readOnlyFiles.Count > 0) { throw new InvalidOperationException( - RelationalDesignStrings.ReadOnlyFiles( + DesignStrings.ReadOnlyFiles( outputPath, string.Join( CultureInfo.CurrentCulture.TextInfo.ListSeparator, readOnlyFiles))); @@ -151,7 +151,7 @@ namespace Microsoft.EntityFrameworkCore.Scaffolding.Internal if (existingFiles.Count > 0) { throw new InvalidOperationException( - RelationalDesignStrings.ExistingFiles( + DesignStrings.ExistingFiles( outputPath, string.Join( CultureInfo.CurrentCulture.TextInfo.ListSeparator, existingFiles))); diff --git a/src/EFCore.Relational.Design/Internal/NullPluralizer.cs b/src/EFCore.Design/Scaffolding/Internal/NullPluralizer.cs similarity index 100% rename from src/EFCore.Relational.Design/Internal/NullPluralizer.cs rename to src/EFCore.Design/Scaffolding/Internal/NullPluralizer.cs diff --git a/src/EFCore.Relational.Design/RelationalScaffoldingModelFactory.cs b/src/EFCore.Design/Scaffolding/Internal/RelationalScaffoldingModelFactory.cs similarity index 99% rename from src/EFCore.Relational.Design/RelationalScaffoldingModelFactory.cs rename to src/EFCore.Design/Scaffolding/Internal/RelationalScaffoldingModelFactory.cs index 7b41f96330..d830581008 100644 --- a/src/EFCore.Relational.Design/RelationalScaffoldingModelFactory.cs +++ b/src/EFCore.Design/Scaffolding/Internal/RelationalScaffoldingModelFactory.cs @@ -256,7 +256,7 @@ namespace Microsoft.EntityFrameworkCore.Scaffolding if (keyBuilder == null) { - var errorMessage = RelationalDesignStrings.LogUnableToGenerateEntityType.GenerateMessage(table.DisplayName); + var errorMessage = DesignStrings.LogUnableToGenerateEntityType.GenerateMessage(table.DisplayName); Logger.UnableToGenerateEntityTypeWarning(table.DisplayName); var model = modelBuilder.Model; diff --git a/src/EFCore.Relational.Design.Specification.Tests/EFCore.Relational.Design.Specification.Tests.csproj b/src/EFCore.Relational.Design.Specification.Tests/EFCore.Relational.Design.Specification.Tests.csproj index b3488c9b4e..1118ab2765 100644 --- a/src/EFCore.Relational.Design.Specification.Tests/EFCore.Relational.Design.Specification.Tests.csproj +++ b/src/EFCore.Relational.Design.Specification.Tests/EFCore.Relational.Design.Specification.Tests.csproj @@ -15,7 +15,7 @@ - + diff --git a/src/EFCore.Relational.Design/Diagnostics/RelationalDesignEventId.cs b/src/EFCore.Relational.Design/Diagnostics/RelationalDesignEventId.cs deleted file mode 100644 index 3447e4ef28..0000000000 --- a/src/EFCore.Relational.Design/Diagnostics/RelationalDesignEventId.cs +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Diagnostics; -using Microsoft.Extensions.Logging; - -namespace Microsoft.EntityFrameworkCore.Diagnostics -{ - /// - /// - /// Event IDs for relational design events that correspond to messages logged to an - /// and events sent to a . - /// - /// - /// These IDs are also used with to configure the - /// behavior of warnings. - /// - /// - public static class RelationalDesignEventId - { - // Warning: These values must not change between releases. - // Only add new values to the end of sections, never in the middle. - // Try to use naming and be consistent with existing names. - private enum Id - { - // Scaffolding warning events - MissingSchemaWarning = CoreEventId.RelationalDesignBaseId, - MissingTableWarning, - SequenceNotNamedWarning, - SequenceTypeNotSupportedWarning, - UnableToGenerateEntityTypeWarning, - ColumnTypeNotMappedWarning, - MissingPrimaryKeyWarning, - PrimaryKeyColumnsNotMappedWarning, - IndexColumnsNotMappedWarning, - ForeignKeyReferencesMissingTableWarning, - ForeignKeyReferencesMissingPrincipalTableWarning, - ForeignKeyReferencesNotMappedTableWarning, - ForeignKeyColumnsNotMappedWarning, - ForeignKeyReferencesMissingPrincipalKeyWarning, - ForeignKeyPrincipalEndContainsNullableColumnsWarning, - ForeignKeyNotNamedWarning, - ForeignKeyColumnMissingWarning, - ForeignKeyColumnNotNamedWarning, - ForeignKeyPrincipalColumnMissingWarning, - ColumnNotNamedWarning, - IndexNotNamedWarning, - IndexTableMissingWarning, - IndexColumnNotNamedWarning, - - // Scaffolding events - TableFound = CoreEventId.RelationalDesignBaseId + 1000, - TableSkipped, - ColumnSkipped, - IndexFound, - IndexColumnFound, - IndexColumnSkipped, - SequenceFound - } - - private static readonly string _scaffoldingPrefix = DbLoggerCategory.Scaffolding.Name + "."; - private static EventId MakeScaffoldingId(Id id) => new EventId((int)id, _scaffoldingPrefix + id); - - /// - /// The database is missing a schema. - /// This event is in the category. - /// - public static readonly EventId MissingSchemaWarning = MakeScaffoldingId(Id.MissingSchemaWarning); - - /// - /// The database is missing a table. - /// This event is in the category. - /// - public static readonly EventId MissingTableWarning = MakeScaffoldingId(Id.MissingTableWarning); - - /// - /// The database has an unnamed sequence. - /// This event is in the category. - /// - public static readonly EventId SequenceNotNamedWarning = MakeScaffoldingId(Id.SequenceNotNamedWarning); - - /// - /// The database has a sequence of a type that is not supported. - /// This event is in the category. - /// - public static readonly EventId SequenceTypeNotSupportedWarning = MakeScaffoldingId(Id.SequenceTypeNotSupportedWarning); - - /// - /// An entity type could not be generated. - /// This event is in the category. - /// - public static readonly EventId UnableToGenerateEntityTypeWarning = MakeScaffoldingId(Id.UnableToGenerateEntityTypeWarning); - - /// - /// A column type could not be mapped. - /// This event is in the category. - /// - public static readonly EventId ColumnTypeNotMappedWarning = MakeScaffoldingId(Id.ColumnTypeNotMappedWarning); - - /// - /// A table is missing a primary key. - /// This event is in the category. - /// - public static readonly EventId MissingPrimaryKeyWarning = MakeScaffoldingId(Id.MissingPrimaryKeyWarning); - - /// - /// Columns in a primary key were not mapped. - /// This event is in the category. - /// - public static readonly EventId PrimaryKeyColumnsNotMappedWarning = MakeScaffoldingId(Id.PrimaryKeyColumnsNotMappedWarning); - - /// - /// Columns in an index were not mapped. - /// This event is in the category. - /// - public static readonly EventId IndexColumnsNotMappedWarning = MakeScaffoldingId(Id.IndexColumnsNotMappedWarning); - - /// - /// A foreign key references a missing table. - /// This event is in the category. - /// - public static readonly EventId ForeignKeyReferencesMissingTableWarning = MakeScaffoldingId(Id.ForeignKeyReferencesMissingTableWarning); - - /// - /// A foreign key references a missing table at the principal end. - /// This event is in the category. - /// - public static readonly EventId ForeignKeyReferencesMissingPrincipalTableWarning = MakeScaffoldingId(Id.ForeignKeyReferencesMissingPrincipalTableWarning); - - /// - /// A foreign key references a table that was not mapped. - /// This event is in the category. - /// - public static readonly EventId ForeignKeyReferencesNotMappedTableWarning = MakeScaffoldingId(Id.ForeignKeyReferencesNotMappedTableWarning); - - /// - /// Columns in a foreign key were not mapped. - /// This event is in the category. - /// - public static readonly EventId ForeignKeyColumnsNotMappedWarning = MakeScaffoldingId(Id.ForeignKeyColumnsNotMappedWarning); - - /// - /// A foreign key references missing prinicpal key columns. - /// This event is in the category. - /// - public static readonly EventId ForeignKeyReferencesMissingPrincipalKeyWarning = MakeScaffoldingId(Id.ForeignKeyReferencesMissingPrincipalKeyWarning); - - /// - /// A principal key contains nullable columns. - /// This event is in the category. - /// - public static readonly EventId ForeignKeyPrincipalEndContainsNullableColumnsWarning = MakeScaffoldingId(Id.ForeignKeyPrincipalEndContainsNullableColumnsWarning); - - /// - /// A foreign key is not named. - /// This event is in the category. - /// - public static readonly EventId ForeignKeyNotNamedWarning = MakeScaffoldingId(Id.ForeignKeyNotNamedWarning); - - /// - /// A foreign key column was not found. - /// This event is in the category. - /// - public static readonly EventId ForeignKeyColumnMissingWarning = MakeScaffoldingId(Id.ForeignKeyColumnMissingWarning); - - /// - /// A column referenced by a foreign key constraint was not found. - /// This event is in the category. - /// - public static readonly EventId ForeignKeyPrincipalColumnMissingWarning = MakeScaffoldingId(Id.ForeignKeyPrincipalColumnMissingWarning); - - /// - /// A foreign key column was not named. - /// This event is in the category. - /// - public static readonly EventId ForeignKeyColumnNotNamedWarning = MakeScaffoldingId(Id.ForeignKeyColumnNotNamedWarning); - - /// - /// A column is not named. - /// This event is in the category. - /// - public static readonly EventId ColumnNotNamedWarning = MakeScaffoldingId(Id.ColumnNotNamedWarning); - - /// - /// An index is not named. - /// This event is in the category. - /// - public static readonly EventId IndexNotNamedWarning = MakeScaffoldingId(Id.IndexNotNamedWarning); - - /// - /// The table referened by an index was not found. - /// This event is in the category. - /// - public static readonly EventId IndexTableMissingWarning = MakeScaffoldingId(Id.IndexTableMissingWarning); - - /// - /// An index column was not named. - /// This event is in the category. - /// - public static readonly EventId IndexColumnNotNamedWarning = MakeScaffoldingId(Id.IndexColumnNotNamedWarning); - - /// - /// A table was found. - /// This event is in the category. - /// - public static readonly EventId TableFound = MakeScaffoldingId(Id.TableFound); - - /// - /// A table was skipped. - /// This event is in the category. - /// - public static readonly EventId TableSkipped = MakeScaffoldingId(Id.TableSkipped); - - /// - /// A column was skipped. - /// This event is in the category. - /// - public static readonly EventId ColumnSkipped = MakeScaffoldingId(Id.ColumnSkipped); - - /// - /// An index was found. - /// This event is in the category. - /// - public static readonly EventId IndexFound = MakeScaffoldingId(Id.IndexFound); - - /// - /// An index was skipped. - /// This event is in the category. - /// - public static readonly EventId IndexColumnFound = MakeScaffoldingId(Id.IndexColumnFound); - - /// - /// A column of an index was skipped. - /// This event is in the category. - /// - public static readonly EventId IndexColumnSkipped = MakeScaffoldingId(Id.IndexColumnSkipped); - - /// - /// A sequence was found. - /// This event is in the category. - /// - public static readonly EventId SequenceFound = MakeScaffoldingId(Id.SequenceFound); - } -} diff --git a/src/EFCore.Relational.Design/EFCore.Relational.Design.csproj b/src/EFCore.Relational.Design/EFCore.Relational.Design.csproj deleted file mode 100644 index 72f8ad01da..0000000000 --- a/src/EFCore.Relational.Design/EFCore.Relational.Design.csproj +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - Shared design-time Entity Framework Core components for relational database providers. - netstandard2.0 - Microsoft.EntityFrameworkCore.Relational.Design - Microsoft.EntityFrameworkCore - $(NoWarn);CS1591 - true - ..\EFCore.ruleset - - - - - - - - - - - - - TextTemplatingFileGenerator - RelationalDesignStrings.Designer.cs - - - - - - - - - - True - True - RelationalDesignStrings.Designer.tt - - - - - - Microsoft.EntityFrameworkCore.Internal - - - - - - - - diff --git a/src/EFCore.Relational.Design/Internal/RelationalDesignLoggerExtensions.cs b/src/EFCore.Relational.Design/Internal/RelationalDesignLoggerExtensions.cs deleted file mode 100644 index fcf00ceb28..0000000000 --- a/src/EFCore.Relational.Design/Internal/RelationalDesignLoggerExtensions.cs +++ /dev/null @@ -1,809 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Collections.Generic; -using System.Diagnostics; -using System.Globalization; -using System.Linq; -using JetBrains.Annotations; -using Microsoft.EntityFrameworkCore.Diagnostics; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.Extensions.Logging; - -namespace Microsoft.EntityFrameworkCore.Internal -{ - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static class RelationalDesignLoggerExtensions - { - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void MissingSchemaWarning( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string schemaName) - { - var definition = RelationalDesignStrings.LogMissingSchema; - - definition.Log(diagnostics, schemaName); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - SchemaName = schemaName - }); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void MissingTableWarning( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string tableName) - { - var definition = RelationalDesignStrings.LogMissingTable; - - definition.Log(diagnostics, tableName); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - TableName = tableName - }); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void SequenceNotNamedWarning( - [NotNull] this IDiagnosticsLogger diagnostics) - { - var definition = RelationalDesignStrings.LogSequencesRequireName; - - definition.Log(diagnostics); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write(definition.EventId.Name, null); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void SequenceTypeNotSupportedWarning( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string sequenceName, - [CanBeNull] string dataTypeName) - { - var definition = RelationalDesignStrings.LogBadSequenceType; - - definition.Log(diagnostics, sequenceName, dataTypeName); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - SequenceName = sequenceName, - DataTypeName = dataTypeName - }); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void UnableToGenerateEntityTypeWarning( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string tableName) - { - var definition = RelationalDesignStrings.LogUnableToGenerateEntityType; - - definition.Log(diagnostics, tableName); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - TableName = tableName - }); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void ColumnTypeNotMappedWarning( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string columnName, - [CanBeNull] string dataTypeName) - { - var definition = RelationalDesignStrings.LogCannotFindTypeMappingForColumn; - - definition.Log(diagnostics, columnName, dataTypeName); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - ColumnName = columnName, - DataTypeName = dataTypeName - }); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void MissingPrimaryKeyWarning( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string tableName) - { - var definition = RelationalDesignStrings.LogMissingPrimaryKey; - - definition.Log(diagnostics, tableName); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - TableName = tableName - }); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void PrimaryKeyColumnsNotMappedWarning( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string tableName, - [NotNull] IList unmappedColumnNames) - { - var definition = RelationalDesignStrings.LogPrimaryKeyErrorPropertyNotFound; - - definition.Log( - diagnostics, - tableName, - string.Join(CultureInfo.CurrentCulture.TextInfo.ListSeparator, unmappedColumnNames)); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - TableName = tableName, - UnmappedColumnNames = unmappedColumnNames - }); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void IndexColumnsNotMappedWarning( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string indexName, - [NotNull] IList unmappedColumnNames) - { - var definition = RelationalDesignStrings.LogUnableToScaffoldIndexMissingProperty; - - definition.Log( - diagnostics, - indexName, - string.Join(CultureInfo.CurrentCulture.TextInfo.ListSeparator, unmappedColumnNames)); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - IndexName = indexName, - UnmappedColumnNames = unmappedColumnNames - }); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void ForeignKeyReferencesMissingTableWarning( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string foreignKeyName) - { - var definition = RelationalDesignStrings.LogForeignKeyScaffoldErrorPrincipalTableNotFound; - - definition.Log(diagnostics, foreignKeyName); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - ForeignKeyName = foreignKeyName - }); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void ForeignKeyReferencesNotMappedTableWarning( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string foreignKeyName, - [NotNull] string principalTableName) - { - var definition = RelationalDesignStrings.LogForeignKeyScaffoldErrorPrincipalTableScaffoldingError; - - definition.Log(diagnostics, foreignKeyName, principalTableName); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - ForeignKeyName = foreignKeyName, - PrincipalTableName = principalTableName - }); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void ForeignKeyColumnsNotMappedWarning( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string foreignKeyName, - [NotNull] IList unmappedColumnNames) - { - var definition = RelationalDesignStrings.LogForeignKeyScaffoldErrorPropertyNotFound; - - definition.Log( - diagnostics, - foreignKeyName, - string.Join(CultureInfo.CurrentCulture.TextInfo.ListSeparator, unmappedColumnNames)); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - ForeignKeyName = foreignKeyName, - UnmappedColumnNames = unmappedColumnNames - }); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void ForeignKeyReferencesMissingPrincipalKeyWarning( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string foreignKeyName, - [CanBeNull] string principalEntityTypeName, - [NotNull] IList principalColumnNames) - { - var definition = RelationalDesignStrings.LogForeignKeyScaffoldErrorPrincipalKeyNotFound; - - definition.Log( - diagnostics, - foreignKeyName, - string.Join(CultureInfo.CurrentCulture.TextInfo.ListSeparator, principalColumnNames), - principalEntityTypeName); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - ForeignKeyName = foreignKeyName, - PrincipalEntityTypeName = principalEntityTypeName, - PrincipalColumnNames = principalColumnNames - }); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void ForeignKeyPrincipalEndContainsNullableColumnsWarning( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string foreignKeyName, - [CanBeNull] string indexName, - [CanBeNull] IList nullablePropertyNames) - { - var definition = RelationalDesignStrings.LogForeignKeyPrincipalEndContainsNullableColumns; - - definition.Log( - diagnostics, - foreignKeyName, - indexName, - nullablePropertyNames.Aggregate((a, b) => a + "," + b)); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - ForeignKeyName = foreignKeyName, - IndexName = indexName, - NullablePropertyNames = nullablePropertyNames - }); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void SequenceFound( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string sequenceName, - [CanBeNull] string sequenceTypeName, - bool? cyclic, - int? increment, - long? start, - long? min, - long? max) - { - var definition = RelationalDesignStrings.LogFoundSequence; - - Debug.Assert(LogLevel.Debug == definition.Level); - - if (diagnostics.GetLogBehavior(definition.EventId, definition.Level) != WarningBehavior.Ignore) - { - definition.Log( - diagnostics, - l => l.LogDebug( - definition.EventId, - null, - definition.MessageFormat, - sequenceName, - sequenceTypeName, - cyclic, - increment, - start, - min, - max)); - } - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - SequenceName = sequenceName, - SequenceTypeName = sequenceTypeName, - Cyclic = cyclic, - Increment = increment, - Start = start, - Min = min, - Max = max - }); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void TableFound( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string tableName) - { - var definition = RelationalDesignStrings.LogFoundTable; - - definition.Log(diagnostics, tableName); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - TableName = tableName - }); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void TableSkipped( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string tableName) - { - var definition = RelationalDesignStrings.LogTableNotInSelectionSet; - - definition.Log(diagnostics, tableName); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - TableName = tableName - }); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void ColumnSkipped( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string tableName, - [CanBeNull] string columnName) - { - var definition = RelationalDesignStrings.LogColumnNotInSelectionSet; - - definition.Log(diagnostics, columnName, tableName); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - TableName = tableName, - ColumnName = columnName - }); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void IndexColumnFound( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string tableName, - [CanBeNull] string indexName, - bool? unique, - [CanBeNull] string columnName, - int? ordinal) - { - var definition = RelationalDesignStrings.LogFoundIndexColumn; - - definition.Log(diagnostics, indexName, tableName, columnName, ordinal); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - TableName = tableName, - IndexName = indexName, - Unique = unique, - ColumnName = columnName, - Ordinal = ordinal - }); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void ColumnNotNamedWarning( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string tableName) - { - var definition = RelationalDesignStrings.LogColumnNameEmptyOnTable; - - definition.Log(diagnostics, tableName); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - TableName = tableName - }); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void IndexColumnSkipped( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string tableName, - [CanBeNull] string indexName, - [CanBeNull] string columnName) - { - var definition = RelationalDesignStrings.LogIndexColumnNotInSelectionSet; - - definition.Log(diagnostics, columnName, indexName, tableName); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - TableName = tableName, - IndexName = indexName, - ColumnName = columnName - }); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void IndexNotNamedWarning( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string tableName) - { - var definition = RelationalDesignStrings.LogIndexNameEmpty; - - definition.Log(diagnostics, tableName); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - TableName = tableName - }); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void IndexTableMissingWarning( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string indexName, - [CanBeNull] string tableName) - { - var definition = RelationalDesignStrings.LogUnableToFindTableForIndex; - - definition.Log(diagnostics, indexName, tableName); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - IndexName = indexName, - TableName = tableName - }); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void IndexColumnNotNamedWarning( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string indexName, - [CanBeNull] string tableName) - { - var definition = RelationalDesignStrings.LogColumnNameEmptyOnIndex; - - definition.Log(diagnostics, indexName, tableName); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - IndexName = indexName, - TableName = tableName - }); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void ForeignKeyNotNamedWarning( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string tableName) - { - var definition = RelationalDesignStrings.LogForeignKeyNameEmpty; - - definition.Log(diagnostics, tableName); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - TableName = tableName - }); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void ForeignKeyColumnMissingWarning( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string columnName, - [CanBeNull] string foreignKeyName, - [CanBeNull] string tableName) - { - var definition = RelationalDesignStrings.LogForeignKeyColumnNotInSelectionSet; - - definition.Log(diagnostics, columnName, foreignKeyName, tableName); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - ColumnName = columnName, - ForeignKeyName = foreignKeyName, - TableName = tableName - }); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void ForeignKeyReferencesMissingPrincipalTableWarning( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string foreignKeyName, - [CanBeNull] string tableName, - [CanBeNull] string principalTableName) - { - var definition = RelationalDesignStrings.LogPrincipalTableNotInSelectionSet; - - definition.Log(diagnostics, foreignKeyName, tableName, principalTableName); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - ForeignKeyName = foreignKeyName, - TableName = tableName, - PrincipalTableName = principalTableName - }); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void ForeignKeyColumnNotNamedWarning( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string foreignKeyName, - [CanBeNull] string tableName) - { - var definition = RelationalDesignStrings.LogColumnNameEmptyOnForeignKey; - - definition.Log(diagnostics, tableName, foreignKeyName); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - ForeignKeyName = foreignKeyName, - TableName = tableName - }); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void IndexFound( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string indexName, - [CanBeNull] string tableName, - bool? unique) - { - var definition = RelationalDesignStrings.LogFoundIndex; - - definition.Log(diagnostics, indexName, tableName, unique); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - IndexName = indexName, - TableName = tableName, - Unique = unique - }); - } - } - - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static void ForeignKeyPrincipalColumnMissingWarning( - [NotNull] this IDiagnosticsLogger diagnostics, - [CanBeNull] string foreignKeyName, - [CanBeNull] string tableName, - [CanBeNull] string principalColumnName, - [CanBeNull] string principalTableName) - { - var definition = RelationalDesignStrings.LogPrincipalColumnNotFound; - - definition.Log(diagnostics, foreignKeyName, tableName, principalColumnName, principalTableName); - - if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) - { - diagnostics.DiagnosticSource.Write( - definition.EventId.Name, - new - { - ForeignKeyName = foreignKeyName, - TableName = tableName, - PrincipalColumnName = principalColumnName, - PrincipalTableName = principalTableName - }); - } - } - } -} diff --git a/src/EFCore.Relational.Design/Properties/InternalsVisibleTo.cs b/src/EFCore.Relational.Design/Properties/InternalsVisibleTo.cs deleted file mode 100644 index effd6c66d7..0000000000 --- a/src/EFCore.Relational.Design/Properties/InternalsVisibleTo.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Microsoft.EntityFrameworkCore.Relational.Design.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] - -// for Moq - -[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] diff --git a/src/EFCore.Relational.Design/Properties/RelationalDesignStrings.Designer.cs b/src/EFCore.Relational.Design/Properties/RelationalDesignStrings.Designer.cs deleted file mode 100644 index 74a7f02001..0000000000 --- a/src/EFCore.Relational.Design/Properties/RelationalDesignStrings.Designer.cs +++ /dev/null @@ -1,413 +0,0 @@ -// - -using System; -using System.Reflection; -using System.Resources; -using JetBrains.Annotations; -using Microsoft.EntityFrameworkCore.Diagnostics; -using Microsoft.Extensions.Logging; - -namespace Microsoft.EntityFrameworkCore.Internal -{ - /// - /// This API supports the Entity Framework Core infrastructure and is not intended to be used - /// directly from your code. This API may change or be removed in future releases. - /// - public static class RelationalDesignStrings - { - private static readonly ResourceManager _resourceManager - = new ResourceManager("Microsoft.EntityFrameworkCore.Properties.RelationalDesignStrings", typeof(RelationalDesignStrings).GetTypeInfo().Assembly); - - /// - /// Metadata model returned should not be null. Provider: {providerTypeName}. - /// - public static string ProviderReturnedNullModel([CanBeNull] object providerTypeName) - => string.Format( - GetString("ProviderReturnedNullModel", nameof(providerTypeName)), - providerTypeName); - - /// - /// No files generated in directory {outputDirectoryName}. The following file(s) already exist and must be made writeable to continue: {readOnlyFiles}. - /// - public static string ReadOnlyFiles([CanBeNull] object outputDirectoryName, [CanBeNull] object readOnlyFiles) - => string.Format( - GetString("ReadOnlyFiles", nameof(outputDirectoryName), nameof(readOnlyFiles)), - outputDirectoryName, readOnlyFiles); - - /// - /// The following file(s) already exist in directory {outputDirectoryName}: {existingFiles}. Use the Force flag to overwrite these files. - /// - public static string ExistingFiles([CanBeNull] object outputDirectoryName, [CanBeNull] object existingFiles) - => string.Format( - GetString("ExistingFiles", nameof(outputDirectoryName), nameof(existingFiles)), - outputDirectoryName, existingFiles); - - /// - /// Found a column on index {indexName} on table {tableName} with an empty or null name. Not including column in index. - /// - public static readonly EventDefinition LogColumnNameEmptyOnIndex - = new EventDefinition( - RelationalDesignEventId.IndexColumnNotNamedWarning, - LogLevel.Warning, - LoggerMessage.Define( - LogLevel.Warning, - RelationalDesignEventId.IndexColumnNotNamedWarning, - _resourceManager.GetString("LogColumnNameEmptyOnIndex"))); - - /// - /// For foreign key with identity {id} on table {tableName}, unable to find the column called {principalColumnName} on the foreign key's principal table, {principaltableName}. Skipping foreign key. - /// - public static readonly EventDefinition LogPrincipalColumnNotFound - = new EventDefinition( - RelationalDesignEventId.ForeignKeyPrincipalColumnMissingWarning, - LogLevel.Warning, - LoggerMessage.Define( - LogLevel.Warning, - RelationalDesignEventId.ForeignKeyPrincipalColumnMissingWarning, - _resourceManager.GetString("LogPrincipalColumnNotFound"))); - - /// - /// Could not find type mapping for column '{columnName}' with data type '{dateType}'. Skipping column. - /// - public static readonly EventDefinition LogCannotFindTypeMappingForColumn - = new EventDefinition( - RelationalDesignEventId.ColumnTypeNotMappedWarning, - LogLevel.Warning, - LoggerMessage.Define( - LogLevel.Warning, - RelationalDesignEventId.ColumnTypeNotMappedWarning, - _resourceManager.GetString("LogCannotFindTypeMappingForColumn"))); - - /// - /// Could not scaffold the foreign key '{foreignKeyName}'. A key for '{columnsList}' was not found in the principal entity type '{principalEntityType}'. - /// - public static readonly EventDefinition LogForeignKeyScaffoldErrorPrincipalKeyNotFound - = new EventDefinition( - RelationalDesignEventId.ForeignKeyReferencesMissingPrincipalKeyWarning, - LogLevel.Warning, - LoggerMessage.Define( - LogLevel.Warning, - RelationalDesignEventId.ForeignKeyReferencesMissingPrincipalKeyWarning, - _resourceManager.GetString("LogForeignKeyScaffoldErrorPrincipalKeyNotFound"))); - - /// - /// Could not scaffold the foreign key '{foreignKeyName}'. The referenced table could not be found. This most likely occurred because the referenced table was excluded from scaffolding. - /// - public static readonly EventDefinition LogForeignKeyScaffoldErrorPrincipalTableNotFound - = new EventDefinition( - RelationalDesignEventId.ForeignKeyReferencesMissingTableWarning, - LogLevel.Warning, - LoggerMessage.Define( - LogLevel.Warning, - RelationalDesignEventId.ForeignKeyReferencesMissingTableWarning, - _resourceManager.GetString("LogForeignKeyScaffoldErrorPrincipalTableNotFound"))); - - /// - /// Could not scaffold the foreign key '{foreignKeyName}'. The referenced table '{principaltableName}' could not be scaffolded. - /// - public static readonly EventDefinition LogForeignKeyScaffoldErrorPrincipalTableScaffoldingError - = new EventDefinition( - RelationalDesignEventId.ForeignKeyReferencesNotMappedTableWarning, - LogLevel.Warning, - LoggerMessage.Define( - LogLevel.Warning, - RelationalDesignEventId.ForeignKeyReferencesNotMappedTableWarning, - _resourceManager.GetString("LogForeignKeyScaffoldErrorPrincipalTableScaffoldingError"))); - - /// - /// Could not scaffold the foreign key '{foreignKeyName}'. The following columns in the foreign key could not be scaffolded: {columnNames}. - /// - public static readonly EventDefinition LogForeignKeyScaffoldErrorPropertyNotFound - = new EventDefinition( - RelationalDesignEventId.ForeignKeyColumnsNotMappedWarning, - LogLevel.Warning, - LoggerMessage.Define( - LogLevel.Warning, - RelationalDesignEventId.ForeignKeyColumnsNotMappedWarning, - _resourceManager.GetString("LogForeignKeyScaffoldErrorPropertyNotFound"))); - - /// - /// Could not scaffold the primary key for '{tableName}'. The following columns in the primary key could not be scaffolded: {columnNames}. - /// - public static readonly EventDefinition LogPrimaryKeyErrorPropertyNotFound - = new EventDefinition( - RelationalDesignEventId.PrimaryKeyColumnsNotMappedWarning, - LogLevel.Warning, - LoggerMessage.Define( - LogLevel.Warning, - RelationalDesignEventId.PrimaryKeyColumnsNotMappedWarning, - _resourceManager.GetString("LogPrimaryKeyErrorPropertyNotFound"))); - - /// - /// Unable to identify the primary key for table '{tableName}'. - /// - public static readonly EventDefinition LogMissingPrimaryKey - = new EventDefinition( - RelationalDesignEventId.MissingPrimaryKeyWarning, - LogLevel.Warning, - LoggerMessage.Define( - LogLevel.Warning, - RelationalDesignEventId.MissingPrimaryKeyWarning, - _resourceManager.GetString("LogMissingPrimaryKey"))); - - /// - /// Found table with name: {name}. - /// - public static readonly EventDefinition LogFoundTable - = new EventDefinition( - RelationalDesignEventId.TableFound, - LogLevel.Debug, - LoggerMessage.Define( - LogLevel.Debug, - RelationalDesignEventId.TableFound, - _resourceManager.GetString("LogFoundTable"))); - - /// - /// Table {tableName} is not included in the selection set. Skipping. - /// - public static readonly EventDefinition LogTableNotInSelectionSet - = new EventDefinition( - RelationalDesignEventId.TableSkipped, - LogLevel.Debug, - LoggerMessage.Define( - LogLevel.Debug, - RelationalDesignEventId.TableSkipped, - _resourceManager.GetString("LogTableNotInSelectionSet"))); - - /// - /// Column {columnName} belongs to table {tableName} which is not included in the selection set. Skipping. - /// - public static readonly EventDefinition LogColumnNotInSelectionSet - = new EventDefinition( - RelationalDesignEventId.ColumnSkipped, - LogLevel.Debug, - LoggerMessage.Define( - LogLevel.Debug, - RelationalDesignEventId.ColumnSkipped, - _resourceManager.GetString("LogColumnNotInSelectionSet"))); - - /// - /// Found index with name: {indexName}, table: {tableName}, is unique: {isUnique}. - /// - public static readonly EventDefinition LogFoundIndex - = new EventDefinition( - RelationalDesignEventId.IndexFound, - LogLevel.Debug, - LoggerMessage.Define( - LogLevel.Debug, - RelationalDesignEventId.IndexFound, - _resourceManager.GetString("LogFoundIndex"))); - - /// - /// Found index column on index {indexName} on table {tableName}, column name: {columnName}, ordinal: {ordinal}. - /// - public static readonly EventDefinition LogFoundIndexColumn - = new EventDefinition( - RelationalDesignEventId.IndexColumnFound, - LogLevel.Debug, - LoggerMessage.Define( - LogLevel.Debug, - RelationalDesignEventId.IndexColumnFound, - _resourceManager.GetString("LogFoundIndexColumn"))); - - /// - /// Index column {columnName} belongs to index {indexName} on table {tableName} which is not included in the selection set. Skipping. - /// - public static readonly EventDefinition LogIndexColumnNotInSelectionSet - = new EventDefinition( - RelationalDesignEventId.IndexColumnSkipped, - LogLevel.Warning, - LoggerMessage.Define( - LogLevel.Warning, - RelationalDesignEventId.IndexColumnSkipped, - _resourceManager.GetString("LogIndexColumnNotInSelectionSet"))); - - /// - /// Found sequence name: {name}, data type: {dataType}, cyclic: {isCyclic}, increment: {increment}, start: {start}, minimum: {min}, maximum: {max}. - /// - public static readonly FallbackEventDefinition LogFoundSequence - = new FallbackEventDefinition( - RelationalDesignEventId.SequenceFound, - LogLevel.Debug, - _resourceManager.GetString("LogFoundSequence")); - - /// - /// Found a column on foreign key {tableName}.{fkName} with an empty or null name. Not including column in foreign key - /// - public static readonly EventDefinition LogColumnNameEmptyOnForeignKey - = new EventDefinition( - RelationalDesignEventId.ForeignKeyColumnNotNamedWarning, - LogLevel.Warning, - LoggerMessage.Define( - LogLevel.Warning, - RelationalDesignEventId.ForeignKeyColumnNotNamedWarning, - _resourceManager.GetString("LogColumnNameEmptyOnForeignKey"))); - - /// - /// Found a column on table {tableName} with an empty or null name. Skipping column. - /// - public static readonly EventDefinition LogColumnNameEmptyOnTable - = new EventDefinition( - RelationalDesignEventId.ColumnNotNamedWarning, - LogLevel.Warning, - LoggerMessage.Define( - LogLevel.Warning, - RelationalDesignEventId.ColumnNotNamedWarning, - _resourceManager.GetString("LogColumnNameEmptyOnTable"))); - - /// - /// For index {indexName}. Unable to find parent table {tableName}. Skipping index. - /// - public static readonly EventDefinition LogUnableToFindTableForIndex - = new EventDefinition( - RelationalDesignEventId.IndexTableMissingWarning, - LogLevel.Warning, - LoggerMessage.Define( - LogLevel.Warning, - RelationalDesignEventId.IndexTableMissingWarning, - _resourceManager.GetString("LogUnableToFindTableForIndex"))); - - /// - /// Found an index on table {tableName} with an empty or null name. Skipping index. - /// - public static readonly EventDefinition LogIndexNameEmpty - = new EventDefinition( - RelationalDesignEventId.IndexNotNamedWarning, - LogLevel.Warning, - LoggerMessage.Define( - LogLevel.Warning, - RelationalDesignEventId.IndexNotNamedWarning, - _resourceManager.GetString("LogIndexNameEmpty"))); - - /// - /// Found a foreign key on table {tableName} with an empty or null name. Skipping foreign key. - /// - public static readonly EventDefinition LogForeignKeyNameEmpty - = new EventDefinition( - RelationalDesignEventId.ForeignKeyNotNamedWarning, - LogLevel.Warning, - LoggerMessage.Define( - LogLevel.Warning, - RelationalDesignEventId.ForeignKeyNotNamedWarning, - _resourceManager.GetString("LogForeignKeyNameEmpty"))); - - /// - /// Foreign key column {columnName} belongs to foreign key {fkName} on table {tableName} which is not included in the selection set. Skipping. - /// - public static readonly EventDefinition LogForeignKeyColumnNotInSelectionSet - = new EventDefinition( - RelationalDesignEventId.ForeignKeyColumnMissingWarning, - LogLevel.Warning, - LoggerMessage.Define( - LogLevel.Warning, - RelationalDesignEventId.ForeignKeyColumnMissingWarning, - _resourceManager.GetString("LogForeignKeyColumnNotInSelectionSet"))); - - /// - /// For foreign key {fkName} on table {tableName}, unable to model the end of the foreign key on principal table {principaltableName}. This is usually because the principal table was not included in the selection set. - /// - public static readonly EventDefinition LogPrincipalTableNotInSelectionSet - = new EventDefinition( - RelationalDesignEventId.ForeignKeyReferencesMissingPrincipalTableWarning, - LogLevel.Warning, - LoggerMessage.Define( - LogLevel.Warning, - RelationalDesignEventId.ForeignKeyReferencesMissingPrincipalTableWarning, - _resourceManager.GetString("LogPrincipalTableNotInSelectionSet"))); - - /// - /// Unable to generate entity type for table '{tableName}'. - /// - public static readonly EventDefinition LogUnableToGenerateEntityType - = new EventDefinition( - RelationalDesignEventId.UnableToGenerateEntityTypeWarning, - LogLevel.Warning, - LoggerMessage.Define( - LogLevel.Warning, - RelationalDesignEventId.UnableToGenerateEntityTypeWarning, - _resourceManager.GetString("LogUnableToGenerateEntityType"))); - - /// - /// Unable to scaffold the index '{indexName}'. The following columns could not be scaffolded: {columnNames}. - /// - public static readonly EventDefinition LogUnableToScaffoldIndexMissingProperty - = new EventDefinition( - RelationalDesignEventId.IndexColumnsNotMappedWarning, - LogLevel.Warning, - LoggerMessage.Define( - LogLevel.Warning, - RelationalDesignEventId.IndexColumnsNotMappedWarning, - _resourceManager.GetString("LogUnableToScaffoldIndexMissingProperty"))); - - /// - /// Sequence name cannot be null or empty. Entity Framework cannot model a sequence that does not have a name. - /// - public static readonly EventDefinition LogSequencesRequireName - = new EventDefinition( - RelationalDesignEventId.SequenceNotNamedWarning, - LogLevel.Warning, - LoggerMessage.Define( - LogLevel.Warning, - RelationalDesignEventId.SequenceNotNamedWarning, - _resourceManager.GetString("LogSequencesRequireName"))); - - /// - /// For sequence '{sequenceName}'. Unable to scaffold because it uses an unsupported type: '{typeName}'. - /// - public static readonly EventDefinition LogBadSequenceType - = new EventDefinition( - RelationalDesignEventId.SequenceTypeNotSupportedWarning, - LogLevel.Warning, - LoggerMessage.Define( - LogLevel.Warning, - RelationalDesignEventId.SequenceTypeNotSupportedWarning, - _resourceManager.GetString("LogBadSequenceType"))); - - /// - /// Unable to find a schema in the database matching the selected schema {schema}. - /// - public static readonly EventDefinition LogMissingSchema - = new EventDefinition( - RelationalDesignEventId.MissingSchemaWarning, - LogLevel.Warning, - LoggerMessage.Define( - LogLevel.Warning, - RelationalDesignEventId.MissingSchemaWarning, - _resourceManager.GetString("LogMissingSchema"))); - - /// - /// Unable to find a table in the database matching the selected table {table}. - /// - public static readonly EventDefinition LogMissingTable - = new EventDefinition( - RelationalDesignEventId.MissingTableWarning, - LogLevel.Warning, - LoggerMessage.Define( - LogLevel.Warning, - RelationalDesignEventId.MissingTableWarning, - _resourceManager.GetString("LogMissingTable"))); - - /// - /// The principal end of the foreign key '{foreignKeyName}' is supported by the unique index '{indexName}' and contains the following nullable columns '{columnNames}'. Entity Framework requires the properties representing those columns to be non-nullable. - /// - public static readonly EventDefinition LogForeignKeyPrincipalEndContainsNullableColumns - = new EventDefinition( - RelationalDesignEventId.ForeignKeyPrincipalEndContainsNullableColumnsWarning, - LogLevel.Warning, - LoggerMessage.Define( - LogLevel.Warning, - RelationalDesignEventId.ForeignKeyPrincipalEndContainsNullableColumnsWarning, - _resourceManager.GetString("LogForeignKeyPrincipalEndContainsNullableColumns"))); - - private static string GetString(string name, params string[] formatterNames) - { - var value = _resourceManager.GetString(name); - for (var i = 0; i < formatterNames.Length; i++) - { - value = value.Replace("{" + formatterNames[i] + "}", "{" + i + "}"); - } - - return value; - } - } -} diff --git a/src/EFCore.Relational.Design/Properties/RelationalDesignStrings.Designer.tt b/src/EFCore.Relational.Design/Properties/RelationalDesignStrings.Designer.tt deleted file mode 100644 index 673499d875..0000000000 --- a/src/EFCore.Relational.Design/Properties/RelationalDesignStrings.Designer.tt +++ /dev/null @@ -1,4 +0,0 @@ -<# - Session["ResourceFile"] = "RelationalDesignStrings.resx"; -#> -<#@ include file="..\..\..\tools\Resources.tt" #> \ No newline at end of file diff --git a/src/EFCore.Relational.Design/Properties/RelationalDesignStrings.resx b/src/EFCore.Relational.Design/Properties/RelationalDesignStrings.resx deleted file mode 100644 index 4b52ead0d2..0000000000 --- a/src/EFCore.Relational.Design/Properties/RelationalDesignStrings.resx +++ /dev/null @@ -1,249 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Metadata model returned should not be null. Provider: {providerTypeName}. - - - No files generated in directory {outputDirectoryName}. The following file(s) already exist and must be made writeable to continue: {readOnlyFiles}. - - - The following file(s) already exist in directory {outputDirectoryName}: {existingFiles}. Use the Force flag to overwrite these files. - - - Found a column on index {indexName} on table {tableName} with an empty or null name. Not including column in index. - Warning RelationalDesignEventId.IndexColumnNotNamedWarning string string - - - For foreign key with identity {id} on table {tableName}, unable to find the column called {principalColumnName} on the foreign key's principal table, {principaltableName}. Skipping foreign key. - Warning RelationalDesignEventId.ForeignKeyPrincipalColumnMissingWarning string string string string - - - Could not find type mapping for column '{columnName}' with data type '{dateType}'. Skipping column. - Warning RelationalDesignEventId.ColumnTypeNotMappedWarning string string - - - Could not scaffold the foreign key '{foreignKeyName}'. A key for '{columnsList}' was not found in the principal entity type '{principalEntityType}'. - Warning RelationalDesignEventId.ForeignKeyReferencesMissingPrincipalKeyWarning string string string - - - Could not scaffold the foreign key '{foreignKeyName}'. The referenced table could not be found. This most likely occurred because the referenced table was excluded from scaffolding. - Warning RelationalDesignEventId.ForeignKeyReferencesMissingTableWarning string - - - Could not scaffold the foreign key '{foreignKeyName}'. The referenced table '{principaltableName}' could not be scaffolded. - Warning RelationalDesignEventId.ForeignKeyReferencesNotMappedTableWarning string string - - - Could not scaffold the foreign key '{foreignKeyName}'. The following columns in the foreign key could not be scaffolded: {columnNames}. - Warning RelationalDesignEventId.ForeignKeyColumnsNotMappedWarning string string - - - Could not scaffold the primary key for '{tableName}'. The following columns in the primary key could not be scaffolded: {columnNames}. - Warning RelationalDesignEventId.PrimaryKeyColumnsNotMappedWarning string string - - - Unable to identify the primary key for table '{tableName}'. - Warning RelationalDesignEventId.MissingPrimaryKeyWarning string - - - Found table with name: {name}. - Debug RelationalDesignEventId.TableFound string - - - Table {tableName} is not included in the selection set. Skipping. - Debug RelationalDesignEventId.TableSkipped string - - - Column {columnName} belongs to table {tableName} which is not included in the selection set. Skipping. - Debug RelationalDesignEventId.ColumnSkipped string string - - - Found index with name: {indexName}, table: {tableName}, is unique: {isUnique}. - Debug RelationalDesignEventId.IndexFound string string bool? - - - Found index column on index {indexName} on table {tableName}, column name: {columnName}, ordinal: {ordinal}. - Debug RelationalDesignEventId.IndexColumnFound string string string int? - - - Index column {columnName} belongs to index {indexName} on table {tableName} which is not included in the selection set. Skipping. - Warning RelationalDesignEventId.IndexColumnSkipped string string string - - - Found sequence name: {name}, data type: {dataType}, cyclic: {isCyclic}, increment: {increment}, start: {start}, minimum: {min}, maximum: {max}. - Debug RelationalDesignEventId.SequenceFound string string bool? int? long? long? long? - - - Found a column on foreign key {tableName}.{fkName} with an empty or null name. Not including column in foreign key - Warning RelationalDesignEventId.ForeignKeyColumnNotNamedWarning string string - - - Found a column on table {tableName} with an empty or null name. Skipping column. - Warning RelationalDesignEventId.ColumnNotNamedWarning string - - - For index {indexName}. Unable to find parent table {tableName}. Skipping index. - Warning RelationalDesignEventId.IndexTableMissingWarning string string - - - Found an index on table {tableName} with an empty or null name. Skipping index. - Warning RelationalDesignEventId.IndexNotNamedWarning string - - - Found a foreign key on table {tableName} with an empty or null name. Skipping foreign key. - Warning RelationalDesignEventId.ForeignKeyNotNamedWarning string - - - Foreign key column {columnName} belongs to foreign key {fkName} on table {tableName} which is not included in the selection set. Skipping. - Warning RelationalDesignEventId.ForeignKeyColumnMissingWarning string string string - - - For foreign key {fkName} on table {tableName}, unable to model the end of the foreign key on principal table {principaltableName}. This is usually because the principal table was not included in the selection set. - Warning RelationalDesignEventId.ForeignKeyReferencesMissingPrincipalTableWarning string string string - - - Unable to generate entity type for table '{tableName}'. - Warning RelationalDesignEventId.UnableToGenerateEntityTypeWarning string - - - Unable to scaffold the index '{indexName}'. The following columns could not be scaffolded: {columnNames}. - Warning RelationalDesignEventId.IndexColumnsNotMappedWarning string string - - - Sequence name cannot be null or empty. Entity Framework cannot model a sequence that does not have a name. - Warning RelationalDesignEventId.SequenceNotNamedWarning - - - For sequence '{sequenceName}'. Unable to scaffold because it uses an unsupported type: '{typeName}'. - Warning RelationalDesignEventId.SequenceTypeNotSupportedWarning string string - - - Unable to find a schema in the database matching the selected schema {schema}. - Warning RelationalDesignEventId.MissingSchemaWarning string - - - Unable to find a table in the database matching the selected table {table}. - Warning RelationalDesignEventId.MissingTableWarning string - - - The principal end of the foreign key '{foreignKeyName}' is supported by the unique index '{indexName}' and contains the following nullable columns '{columnNames}'. Entity Framework requires the properties representing those columns to be non-nullable. - Warning RelationalDesignEventId.ForeignKeyPrincipalEndContainsNullableColumnsWarning string string string - - \ No newline at end of file diff --git a/src/EFCore.Relational.Design/baseline.netcore.json b/src/EFCore.Relational.Design/baseline.netcore.json deleted file mode 100644 index b61fd95fe2..0000000000 --- a/src/EFCore.Relational.Design/baseline.netcore.json +++ /dev/null @@ -1,3259 +0,0 @@ -{ - "AssemblyIdentity": "Microsoft.EntityFrameworkCore.Relational.Design, Version=1.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", - "Types": [ - { - "Name": "Microsoft.EntityFrameworkCore.Metadata.ScaffoldingMetadataExtensions", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "Static": true, - "Sealed": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "Scaffolding", - "Parameters": [ - { - "Name": "model", - "Type": "Microsoft.EntityFrameworkCore.Metadata.IModel" - } - ], - "ReturnType": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.ScaffoldingModelAnnotations", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Scaffolding", - "Parameters": [ - { - "Name": "property", - "Type": "Microsoft.EntityFrameworkCore.Metadata.IProperty" - } - ], - "ReturnType": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.ScaffoldingPropertyAnnotations", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.EntityFrameworkCore.Internal.RelationalDesignLoggerExtensions", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "Static": true, - "Sealed": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "LogWarning", - "Parameters": [ - { - "Name": "logger", - "Type": "Microsoft.Extensions.Logging.ILogger" - }, - { - "Name": "eventId", - "Type": "Microsoft.EntityFrameworkCore.Infrastructure.RelationalDesignEventId" - }, - { - "Name": "formatter", - "Type": "System.Func" - } - ], - "ReturnType": "System.Void", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "LogDebug", - "Parameters": [ - { - "Name": "logger", - "Type": "Microsoft.Extensions.Logging.ILogger" - }, - { - "Name": "eventId", - "Type": "Microsoft.EntityFrameworkCore.Infrastructure.RelationalDesignEventId" - }, - { - "Name": "formatter", - "Type": "System.Func" - } - ], - "ReturnType": "System.Void", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.EntityFrameworkCore.Internal.RelationalDesignStrings", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "Static": true, - "Sealed": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "CannotFindTypeMappingForColumn", - "Parameters": [ - { - "Name": "columnName", - "Type": "System.Object" - }, - { - "Name": "dateType", - "Type": "System.Object" - } - ], - "ReturnType": "System.String", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "ForeignKeyScaffoldErrorPrincipalKeyNotFound", - "Parameters": [ - { - "Name": "foreignKeyName", - "Type": "System.Object" - }, - { - "Name": "columnsList", - "Type": "System.Object" - }, - { - "Name": "principalEntityType", - "Type": "System.Object" - } - ], - "ReturnType": "System.String", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "ForeignKeyScaffoldErrorPrincipalTableNotFound", - "Parameters": [ - { - "Name": "foreignKeyName", - "Type": "System.Object" - } - ], - "ReturnType": "System.String", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "ForeignKeyScaffoldErrorPrincipalTableScaffoldingError", - "Parameters": [ - { - "Name": "foreignKeyName", - "Type": "System.Object" - }, - { - "Name": "principalTableName", - "Type": "System.Object" - } - ], - "ReturnType": "System.String", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "ForeignKeyScaffoldErrorPropertyNotFound", - "Parameters": [ - { - "Name": "foreignKeyName", - "Type": "System.Object" - }, - { - "Name": "columnNames", - "Type": "System.Object" - } - ], - "ReturnType": "System.String", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "PrimaryKeyErrorPropertyNotFound", - "Parameters": [ - { - "Name": "tableName", - "Type": "System.Object" - }, - { - "Name": "columnNames", - "Type": "System.Object" - } - ], - "ReturnType": "System.String", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "MissingPrimaryKey", - "Parameters": [ - { - "Name": "tableName", - "Type": "System.Object" - } - ], - "ReturnType": "System.String", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "ProviderReturnedNullModel", - "Parameters": [ - { - "Name": "providerTypeName", - "Type": "System.Object" - } - ], - "ReturnType": "System.String", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "ReadOnlyFiles", - "Parameters": [ - { - "Name": "outputDirectoryName", - "Type": "System.Object" - }, - { - "Name": "readOnlyFiles", - "Type": "System.Object" - } - ], - "ReturnType": "System.String", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "UnableToGenerateEntityType", - "Parameters": [ - { - "Name": "tableName", - "Type": "System.Object" - } - ], - "ReturnType": "System.String", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "UnableToScaffoldIndexMissingProperty", - "Parameters": [ - { - "Name": "indexName", - "Type": "System.Object" - }, - { - "Name": "columnNames", - "Type": "System.Object" - } - ], - "ReturnType": "System.String", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_MissingUseProviderMethodNameAnnotation", - "Parameters": [], - "ReturnType": "System.String", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "ExistingFiles", - "Parameters": [ - { - "Name": "outputDirectoryName", - "Type": "System.Object" - }, - { - "Name": "existingFiles", - "Type": "System.Object" - } - ], - "ReturnType": "System.String", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_SequencesRequireName", - "Parameters": [], - "ReturnType": "System.String", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "BadSequenceType", - "Parameters": [ - { - "Name": "sequenceName", - "Type": "System.Object" - }, - { - "Name": "typeName", - "Type": "System.Object" - } - ], - "ReturnType": "System.String", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "MissingSchema", - "Parameters": [ - { - "Name": "schema", - "Type": "System.Object" - } - ], - "ReturnType": "System.String", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "MissingTable", - "Parameters": [ - { - "Name": "table", - "Type": "System.Object" - } - ], - "ReturnType": "System.String", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.EntityFrameworkCore.Infrastructure.RelationalDesignEventId", - "Visibility": "Public", - "Kind": "Enumeration", - "Sealed": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Field", - "Name": "MissingSchemaWarning", - "Parameters": [], - "GenericParameter": [], - "Literal": "1" - }, - { - "Kind": "Field", - "Name": "MissingTableWarning", - "Parameters": [], - "GenericParameter": [], - "Literal": "2" - }, - { - "Kind": "Field", - "Name": "SequenceMustBeNamedWarning", - "Parameters": [], - "GenericParameter": [], - "Literal": "3" - }, - { - "Kind": "Field", - "Name": "SequenceTypeNotSupportedWarning", - "Parameters": [], - "GenericParameter": [], - "Literal": "4" - }, - { - "Kind": "Field", - "Name": "UnableToGenerateEntityTypeWarning", - "Parameters": [], - "GenericParameter": [], - "Literal": "5" - }, - { - "Kind": "Field", - "Name": "ColumnTypeNotMappedWarning", - "Parameters": [], - "GenericParameter": [], - "Literal": "6" - }, - { - "Kind": "Field", - "Name": "MissingPrimaryKeyWarning", - "Parameters": [], - "GenericParameter": [], - "Literal": "7" - }, - { - "Kind": "Field", - "Name": "PrimaryKeyColumnsNotMappedWarning", - "Parameters": [], - "GenericParameter": [], - "Literal": "8" - }, - { - "Kind": "Field", - "Name": "IndexColumnsNotMappedWarning", - "Parameters": [], - "GenericParameter": [], - "Literal": "9" - }, - { - "Kind": "Field", - "Name": "ForeignKeyReferencesMissingTableWarning", - "Parameters": [], - "GenericParameter": [], - "Literal": "10" - }, - { - "Kind": "Field", - "Name": "ForeignKeyColumnsNotMappedWarning", - "Parameters": [], - "GenericParameter": [], - "Literal": "11" - }, - { - "Kind": "Field", - "Name": "ForeignKeyReferencesMissingPrincipalKeyWarning", - "Parameters": [], - "GenericParameter": [], - "Literal": "12" - }, - { - "Kind": "Field", - "Name": "FoundTable", - "Parameters": [], - "GenericParameter": [], - "Literal": "13" - }, - { - "Kind": "Field", - "Name": "TableSkipped", - "Parameters": [], - "GenericParameter": [], - "Literal": "14" - }, - { - "Kind": "Field", - "Name": "FoundColumn", - "Parameters": [], - "GenericParameter": [], - "Literal": "15" - }, - { - "Kind": "Field", - "Name": "ColumnSkipped", - "Parameters": [], - "GenericParameter": [], - "Literal": "16" - }, - { - "Kind": "Field", - "Name": "FoundIndex", - "Parameters": [], - "GenericParameter": [], - "Literal": "17" - }, - { - "Kind": "Field", - "Name": "FoundIndexColumn", - "Parameters": [], - "GenericParameter": [], - "Literal": "18" - }, - { - "Kind": "Field", - "Name": "IndexColumnSkipped", - "Parameters": [], - "GenericParameter": [], - "Literal": "19" - }, - { - "Kind": "Field", - "Name": "FoundForeignKeyColumn", - "Parameters": [], - "GenericParameter": [], - "Literal": "20" - }, - { - "Kind": "Field", - "Name": "FoundSequence", - "Parameters": [], - "GenericParameter": [], - "Literal": "21" - }, - { - "Kind": "Field", - "Name": "ForeignKeyReferencesMissingTable", - "Parameters": [], - "GenericParameter": [], - "Literal": "22" - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.EntityFrameworkCore.Scaffolding.IDatabaseModelFactory", - "Visibility": "Public", - "Kind": "Interface", - "Abstract": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "Create", - "Parameters": [ - { - "Name": "connectionString", - "Type": "System.String" - }, - { - "Name": "tableSelectionSet", - "Type": "Microsoft.EntityFrameworkCore.Scaffolding.TableSelectionSet" - } - ], - "ReturnType": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.DatabaseModel", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.EntityFrameworkCore.Scaffolding.IScaffoldingModelFactory", - "Visibility": "Public", - "Kind": "Interface", - "Abstract": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "Create", - "Parameters": [ - { - "Name": "connectionString", - "Type": "System.String" - }, - { - "Name": "tableSelectionSet", - "Type": "Microsoft.EntityFrameworkCore.Scaffolding.TableSelectionSet" - } - ], - "ReturnType": "Microsoft.EntityFrameworkCore.Metadata.IModel", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.EntityFrameworkCore.Scaffolding.RelationalScaffoldingModelFactory", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [ - "Microsoft.EntityFrameworkCore.Scaffolding.IScaffoldingModelFactory" - ], - "Members": [ - { - "Kind": "Method", - "Name": "get_Logger", - "Parameters": [], - "ReturnType": "Microsoft.Extensions.Logging.ILogger", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_TypeMapper", - "Parameters": [], - "ReturnType": "Microsoft.EntityFrameworkCore.Storage.IRelationalTypeMapper", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_CandidateNamingService", - "Parameters": [], - "ReturnType": "Microsoft.EntityFrameworkCore.Scaffolding.Internal.CandidateNamingService", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Create", - "Parameters": [ - { - "Name": "connectionString", - "Type": "System.String" - }, - { - "Name": "tableSelectionSet", - "Type": "Microsoft.EntityFrameworkCore.Scaffolding.TableSelectionSet" - } - ], - "ReturnType": "Microsoft.EntityFrameworkCore.Metadata.IModel", - "Virtual": true, - "ImplementedInterface": "Microsoft.EntityFrameworkCore.Scaffolding.IScaffoldingModelFactory", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "CheckSelectionsMatched", - "Parameters": [ - { - "Name": "tableSelectionSet", - "Type": "Microsoft.EntityFrameworkCore.Scaffolding.TableSelectionSet" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "CreateFromDatabaseModel", - "Parameters": [ - { - "Name": "databaseModel", - "Type": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.DatabaseModel" - } - ], - "ReturnType": "Microsoft.EntityFrameworkCore.Metadata.IModel", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GetEntityTypeName", - "Parameters": [ - { - "Name": "table", - "Type": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.TableModel" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GetPropertyName", - "Parameters": [ - { - "Name": "column", - "Type": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.ColumnModel" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "VisitDatabaseModel", - "Parameters": [ - { - "Name": "modelBuilder", - "Type": "Microsoft.EntityFrameworkCore.ModelBuilder" - }, - { - "Name": "databaseModel", - "Type": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.DatabaseModel" - } - ], - "ReturnType": "Microsoft.EntityFrameworkCore.ModelBuilder", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "VisitSequences", - "Parameters": [ - { - "Name": "modelBuilder", - "Type": "Microsoft.EntityFrameworkCore.ModelBuilder" - }, - { - "Name": "sequences", - "Type": "System.Collections.Generic.ICollection" - } - ], - "ReturnType": "Microsoft.EntityFrameworkCore.ModelBuilder", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "VisitSequence", - "Parameters": [ - { - "Name": "modelBuilder", - "Type": "Microsoft.EntityFrameworkCore.ModelBuilder" - }, - { - "Name": "sequence", - "Type": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.SequenceModel" - } - ], - "ReturnType": "Microsoft.EntityFrameworkCore.Metadata.RelationalSequenceBuilder", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "VisitTables", - "Parameters": [ - { - "Name": "modelBuilder", - "Type": "Microsoft.EntityFrameworkCore.ModelBuilder" - }, - { - "Name": "tables", - "Type": "System.Collections.Generic.ICollection" - } - ], - "ReturnType": "Microsoft.EntityFrameworkCore.ModelBuilder", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "VisitTable", - "Parameters": [ - { - "Name": "modelBuilder", - "Type": "Microsoft.EntityFrameworkCore.ModelBuilder" - }, - { - "Name": "table", - "Type": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.TableModel" - } - ], - "ReturnType": "Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "VisitColumns", - "Parameters": [ - { - "Name": "builder", - "Type": "Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder" - }, - { - "Name": "columns", - "Type": "System.Collections.Generic.ICollection" - } - ], - "ReturnType": "Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "VisitColumn", - "Parameters": [ - { - "Name": "builder", - "Type": "Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder" - }, - { - "Name": "column", - "Type": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.ColumnModel" - } - ], - "ReturnType": "Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GetTypeMapping", - "Parameters": [ - { - "Name": "column", - "Type": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.ColumnModel" - } - ], - "ReturnType": "Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapping", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "VisitPrimaryKey", - "Parameters": [ - { - "Name": "builder", - "Type": "Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder" - }, - { - "Name": "table", - "Type": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.TableModel" - } - ], - "ReturnType": "Microsoft.EntityFrameworkCore.Metadata.Builders.KeyBuilder", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "VisitIndexes", - "Parameters": [ - { - "Name": "builder", - "Type": "Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder" - }, - { - "Name": "indexes", - "Type": "System.Collections.Generic.ICollection" - } - ], - "ReturnType": "Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "VisitIndex", - "Parameters": [ - { - "Name": "builder", - "Type": "Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder" - }, - { - "Name": "index", - "Type": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.IndexModel" - } - ], - "ReturnType": "Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "VisitForeignKeys", - "Parameters": [ - { - "Name": "modelBuilder", - "Type": "Microsoft.EntityFrameworkCore.ModelBuilder" - }, - { - "Name": "foreignKeys", - "Type": "System.Collections.Generic.IList" - } - ], - "ReturnType": "Microsoft.EntityFrameworkCore.ModelBuilder", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "VisitForeignKey", - "Parameters": [ - { - "Name": "modelBuilder", - "Type": "Microsoft.EntityFrameworkCore.ModelBuilder" - }, - { - "Name": "foreignKey", - "Type": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.ForeignKeyModel" - } - ], - "ReturnType": "Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "AddNavigationProperties", - "Parameters": [ - { - "Name": "foreignKey", - "Type": "Microsoft.EntityFrameworkCore.Metadata.IMutableForeignKey" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "ExistingIdentifiers", - "Parameters": [ - { - "Name": "entityType", - "Type": "Microsoft.EntityFrameworkCore.Metadata.IEntityType" - } - ], - "ReturnType": "System.Collections.Generic.List", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "loggerFactory", - "Type": "Microsoft.Extensions.Logging.ILoggerFactory" - }, - { - "Name": "typeMapper", - "Type": "Microsoft.EntityFrameworkCore.Storage.IRelationalTypeMapper" - }, - { - "Name": "databaseModelFactory", - "Type": "Microsoft.EntityFrameworkCore.Scaffolding.IDatabaseModelFactory" - }, - { - "Name": "candidateNamingService", - "Type": "Microsoft.EntityFrameworkCore.Scaffolding.Internal.CandidateNamingService" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.EntityFrameworkCore.Scaffolding.ScaffoldingTypeMapper", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_TypeMapper", - "Parameters": [], - "ReturnType": "Microsoft.EntityFrameworkCore.Storage.IRelationalTypeMapper", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "FindMapping", - "Parameters": [ - { - "Name": "storeType", - "Type": "System.String" - }, - { - "Name": "keyOrIndex", - "Type": "System.Boolean" - }, - { - "Name": "rowVersion", - "Type": "System.Boolean" - } - ], - "ReturnType": "Microsoft.EntityFrameworkCore.Scaffolding.TypeScaffoldingInfo", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "typeMapper", - "Type": "Microsoft.EntityFrameworkCore.Storage.IRelationalTypeMapper" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.EntityFrameworkCore.Scaffolding.TableSelectionSet", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Schemas", - "Parameters": [], - "ReturnType": "System.Collections.Generic.IReadOnlyList", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Tables", - "Parameters": [], - "ReturnType": "System.Collections.Generic.IReadOnlyList", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "tables", - "Type": "System.Collections.Generic.IEnumerable" - } - ], - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "tables", - "Type": "System.Collections.Generic.IEnumerable" - }, - { - "Name": "schemas", - "Type": "System.Collections.Generic.IEnumerable" - } - ], - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Field", - "Name": "All", - "Parameters": [], - "ReturnType": "Microsoft.EntityFrameworkCore.Scaffolding.TableSelectionSet", - "Static": true, - "ReadOnly": true, - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.EntityFrameworkCore.Scaffolding.TypeScaffoldingInfo", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_ClrType", - "Parameters": [], - "ReturnType": "System.Type", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_IsInferred", - "Parameters": [], - "ReturnType": "System.Boolean", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_ScaffoldUnicode", - "Parameters": [], - "ReturnType": "System.Nullable", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_ScaffoldMaxLength", - "Parameters": [], - "ReturnType": "System.Nullable", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "clrType", - "Type": "System.Type" - }, - { - "Name": "inferred", - "Type": "System.Boolean" - }, - { - "Name": "scaffoldUnicode", - "Type": "System.Nullable" - }, - { - "Name": "scaffoldMaxLength", - "Type": "System.Nullable" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.ColumnModel", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.EntityFrameworkCore.Infrastructure.Annotatable", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Table", - "Parameters": [], - "ReturnType": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.TableModel", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Table", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.TableModel" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Name", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Name", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_PrimaryKeyOrdinal", - "Parameters": [], - "ReturnType": "System.Nullable", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_PrimaryKeyOrdinal", - "Parameters": [ - { - "Name": "value", - "Type": "System.Nullable" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Ordinal", - "Parameters": [], - "ReturnType": "System.Int32", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Ordinal", - "Parameters": [ - { - "Name": "value", - "Type": "System.Int32" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_IsNullable", - "Parameters": [], - "ReturnType": "System.Boolean", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_IsNullable", - "Parameters": [ - { - "Name": "value", - "Type": "System.Boolean" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_DataType", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_DataType", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_DefaultValue", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_DefaultValue", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_ComputedValue", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_ComputedValue", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_MaxLength", - "Parameters": [], - "ReturnType": "System.Nullable", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_MaxLength", - "Parameters": [ - { - "Name": "value", - "Type": "System.Nullable" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Precision", - "Parameters": [], - "ReturnType": "System.Nullable", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Precision", - "Parameters": [ - { - "Name": "value", - "Type": "System.Nullable" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Scale", - "Parameters": [], - "ReturnType": "System.Nullable", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Scale", - "Parameters": [ - { - "Name": "value", - "Type": "System.Nullable" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_ValueGenerated", - "Parameters": [], - "ReturnType": "System.Nullable", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_ValueGenerated", - "Parameters": [ - { - "Name": "value", - "Type": "System.Nullable" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_DisplayName", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.DatabaseModel", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.EntityFrameworkCore.Infrastructure.Annotatable", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_DatabaseName", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_DatabaseName", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_DefaultSchemaName", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_DefaultSchemaName", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Tables", - "Parameters": [], - "ReturnType": "System.Collections.Generic.ICollection", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Sequences", - "Parameters": [], - "ReturnType": "System.Collections.Generic.ICollection", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.ForeignKeyColumnModel", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.EntityFrameworkCore.Infrastructure.Annotatable", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Ordinal", - "Parameters": [], - "ReturnType": "System.Int32", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Ordinal", - "Parameters": [ - { - "Name": "value", - "Type": "System.Int32" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Column", - "Parameters": [], - "ReturnType": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.ColumnModel", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Column", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.ColumnModel" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_PrincipalColumn", - "Parameters": [], - "ReturnType": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.ColumnModel", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_PrincipalColumn", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.ColumnModel" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.ForeignKeyModel", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.EntityFrameworkCore.Infrastructure.Annotatable", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Table", - "Parameters": [], - "ReturnType": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.TableModel", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Table", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.TableModel" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_PrincipalTable", - "Parameters": [], - "ReturnType": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.TableModel", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_PrincipalTable", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.TableModel" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Columns", - "Parameters": [], - "ReturnType": "System.Collections.Generic.ICollection", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Name", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Name", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_OnDelete", - "Parameters": [], - "ReturnType": "System.Nullable", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_OnDelete", - "Parameters": [ - { - "Name": "value", - "Type": "System.Nullable" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_DisplayName", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.IndexColumnModel", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.EntityFrameworkCore.Infrastructure.Annotatable", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Ordinal", - "Parameters": [], - "ReturnType": "System.Int32", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Ordinal", - "Parameters": [ - { - "Name": "value", - "Type": "System.Int32" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Column", - "Parameters": [], - "ReturnType": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.ColumnModel", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Column", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.ColumnModel" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Index", - "Parameters": [], - "ReturnType": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.IndexModel", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Index", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.IndexModel" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.IndexModel", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.EntityFrameworkCore.Infrastructure.Annotatable", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Table", - "Parameters": [], - "ReturnType": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.TableModel", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Table", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.TableModel" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Name", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Name", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_IndexColumns", - "Parameters": [], - "ReturnType": "System.Collections.Generic.ICollection", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_IndexColumns", - "Parameters": [ - { - "Name": "value", - "Type": "System.Collections.Generic.ICollection" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_IsUnique", - "Parameters": [], - "ReturnType": "System.Boolean", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_IsUnique", - "Parameters": [ - { - "Name": "value", - "Type": "System.Boolean" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.ScaffoldingModelAnnotations", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.EntityFrameworkCore.Metadata.RelationalModelAnnotations", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_UseProviderMethodName", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_UseProviderMethodName", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_EntityTypeErrors", - "Parameters": [], - "ReturnType": "System.Collections.Generic.IDictionary", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_EntityTypeErrors", - "Parameters": [ - { - "Name": "value", - "Type": "System.Collections.Generic.IDictionary" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "model", - "Type": "Microsoft.EntityFrameworkCore.Metadata.IModel" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.ScaffoldingPropertyAnnotations", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.EntityFrameworkCore.Metadata.RelationalPropertyAnnotations", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_ColumnOrdinal", - "Parameters": [], - "ReturnType": "System.Int32", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_ColumnOrdinal", - "Parameters": [ - { - "Name": "value", - "Type": "System.Int32" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "property", - "Type": "Microsoft.EntityFrameworkCore.Metadata.IProperty" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.SequenceModel", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.EntityFrameworkCore.Infrastructure.Annotatable", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Database", - "Parameters": [], - "ReturnType": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.DatabaseModel", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Database", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.DatabaseModel" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Name", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Name", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_SchemaName", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_SchemaName", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_DataType", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_DataType", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Start", - "Parameters": [], - "ReturnType": "System.Nullable", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Start", - "Parameters": [ - { - "Name": "value", - "Type": "System.Nullable" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_IncrementBy", - "Parameters": [], - "ReturnType": "System.Nullable", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_IncrementBy", - "Parameters": [ - { - "Name": "value", - "Type": "System.Nullable" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Min", - "Parameters": [], - "ReturnType": "System.Nullable", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Min", - "Parameters": [ - { - "Name": "value", - "Type": "System.Nullable" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Max", - "Parameters": [], - "ReturnType": "System.Nullable", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Max", - "Parameters": [ - { - "Name": "value", - "Type": "System.Nullable" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_IsCyclic", - "Parameters": [], - "ReturnType": "System.Nullable", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_IsCyclic", - "Parameters": [ - { - "Name": "value", - "Type": "System.Nullable" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.TableModel", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.EntityFrameworkCore.Infrastructure.Annotatable", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Database", - "Parameters": [], - "ReturnType": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.DatabaseModel", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Database", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.DatabaseModel" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Name", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Name", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_SchemaName", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_SchemaName", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Columns", - "Parameters": [], - "ReturnType": "System.Collections.Generic.ICollection", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Columns", - "Parameters": [ - { - "Name": "value", - "Type": "System.Collections.Generic.ICollection" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Indexes", - "Parameters": [], - "ReturnType": "System.Collections.Generic.ICollection", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_ForeignKeys", - "Parameters": [], - "ReturnType": "System.Collections.Generic.ICollection", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_DisplayName", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.Internal.ScaffoldingAnnotationNames", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "Static": true, - "Sealed": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Field", - "Name": "Prefix", - "Parameters": [], - "ReturnType": "System.String", - "Static": true, - "Visibility": "Public", - "GenericParameter": [], - "Constant": true, - "Literal": "\"Scaffolding:\"" - }, - { - "Kind": "Field", - "Name": "UseProviderMethodName", - "Parameters": [], - "ReturnType": "System.String", - "Static": true, - "Visibility": "Public", - "GenericParameter": [], - "Constant": true, - "Literal": "\"UseProviderMethodName\"" - }, - { - "Kind": "Field", - "Name": "ColumnOrdinal", - "Parameters": [], - "ReturnType": "System.String", - "Static": true, - "Visibility": "Public", - "GenericParameter": [], - "Constant": true, - "Literal": "\"ColumnOrdinal\"" - }, - { - "Kind": "Field", - "Name": "DependentEndNavigation", - "Parameters": [], - "ReturnType": "System.String", - "Static": true, - "Visibility": "Public", - "GenericParameter": [], - "Constant": true, - "Literal": "\"DependentEndNavigation\"" - }, - { - "Kind": "Field", - "Name": "PrincipalEndNavigation", - "Parameters": [], - "ReturnType": "System.String", - "Static": true, - "Visibility": "Public", - "GenericParameter": [], - "Constant": true, - "Literal": "\"PrincipalEndNavigation\"" - }, - { - "Kind": "Field", - "Name": "EntityTypeErrors", - "Parameters": [], - "ReturnType": "System.String", - "Static": true, - "Visibility": "Public", - "GenericParameter": [], - "Constant": true, - "Literal": "\"EntityTypeErrors\"" - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.Internal.ScaffoldingFullAnnotationNames", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.EntityFrameworkCore.Metadata.Internal.RelationalFullAnnotationNames", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Instance", - "Parameters": [], - "ReturnType": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.Internal.ScaffoldingFullAnnotationNames", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "prefix", - "Type": "System.String" - } - ], - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Field", - "Name": "UseProviderMethodName", - "Parameters": [], - "ReturnType": "System.String", - "ReadOnly": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Field", - "Name": "ColumnOrdinal", - "Parameters": [], - "ReturnType": "System.String", - "ReadOnly": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Field", - "Name": "DependentEndNavigation", - "Parameters": [], - "ReturnType": "System.String", - "ReadOnly": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Field", - "Name": "PrincipalEndNavigation", - "Parameters": [], - "ReturnType": "System.String", - "ReadOnly": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Field", - "Name": "EntityTypeErrors", - "Parameters": [], - "ReturnType": "System.String", - "ReadOnly": true, - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.EntityFrameworkCore.Scaffolding.Internal.CandidateNamingService", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "GenerateCandidateIdentifier", - "Parameters": [ - { - "Name": "originalIdentifier", - "Type": "System.String" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GetDependentEndCandidateNavigationPropertyName", - "Parameters": [ - { - "Name": "foreignKey", - "Type": "Microsoft.EntityFrameworkCore.Metadata.IForeignKey" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GetPrincipalEndCandidateNavigationPropertyName", - "Parameters": [ - { - "Name": "foreignKey", - "Type": "Microsoft.EntityFrameworkCore.Metadata.IForeignKey" - }, - { - "Name": "dependentEndNavigationPropertyName", - "Type": "System.String" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.EntityFrameworkCore.Scaffolding.Internal.CSharpNamer", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "GetName", - "Parameters": [ - { - "Name": "item", - "Type": "T0" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "nameGetter", - "Type": "System.Func" - } - ], - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Field", - "Name": "NameCache", - "Parameters": [], - "ReturnType": "System.Collections.Generic.Dictionary", - "ReadOnly": true, - "Visibility": "Protected", - "GenericParameter": [] - } - ], - "GenericParameters": [ - { - "ParameterName": "T", - "ParameterPosition": 0, - "BaseTypeOrInterfaces": [] - } - ] - }, - { - "Name": "Microsoft.EntityFrameworkCore.Scaffolding.Internal.CSharpUniqueNamer", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.EntityFrameworkCore.Scaffolding.Internal.CSharpNamer", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "GetName", - "Parameters": [ - { - "Name": "item", - "Type": "T0" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "nameGetter", - "Type": "System.Func" - } - ], - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "nameGetter", - "Type": "System.Func" - }, - { - "Name": "usedNames", - "Type": "System.Collections.Generic.IEnumerable" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [ - { - "ParameterName": "T", - "ParameterPosition": 0, - "BaseTypeOrInterfaces": [] - } - ] - }, - { - "Name": "Microsoft.EntityFrameworkCore.Scaffolding.Internal.CSharpUtilities", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Instance", - "Parameters": [], - "ReturnType": "Microsoft.EntityFrameworkCore.Scaffolding.Internal.CSharpUtilities", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "DelimitString", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "EscapeString", - "Parameters": [ - { - "Name": "str", - "Type": "System.String" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "EscapeVerbatimString", - "Parameters": [ - { - "Name": "str", - "Type": "System.String" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GenerateLiteral", - "Parameters": [ - { - "Name": "value", - "Type": "System.Byte[]" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GenerateLiteral", - "Parameters": [ - { - "Name": "value", - "Type": "System.Boolean" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GenerateLiteral", - "Parameters": [ - { - "Name": "value", - "Type": "System.Int32" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GenerateLiteral", - "Parameters": [ - { - "Name": "value", - "Type": "System.Int64" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GenerateLiteral", - "Parameters": [ - { - "Name": "value", - "Type": "System.Decimal" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GenerateLiteral", - "Parameters": [ - { - "Name": "value", - "Type": "System.Single" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GenerateLiteral", - "Parameters": [ - { - "Name": "value", - "Type": "System.Double" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GenerateLiteral", - "Parameters": [ - { - "Name": "value", - "Type": "System.TimeSpan" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GenerateLiteral", - "Parameters": [ - { - "Name": "value", - "Type": "System.DateTime" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GenerateLiteral", - "Parameters": [ - { - "Name": "value", - "Type": "System.DateTimeOffset" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GenerateLiteral", - "Parameters": [ - { - "Name": "value", - "Type": "System.Guid" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GenerateLiteral", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GenerateVerbatimStringLiteral", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GenerateLiteral", - "Parameters": [ - { - "Name": "value", - "Type": "System.Object" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "IsCSharpKeyword", - "Parameters": [ - { - "Name": "identifier", - "Type": "System.String" - } - ], - "ReturnType": "System.Boolean", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GenerateCSharpIdentifier", - "Parameters": [ - { - "Name": "identifier", - "Type": "System.String" - }, - { - "Name": "existingIdentifiers", - "Type": "System.Collections.Generic.ICollection" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GenerateCSharpIdentifier", - "Parameters": [ - { - "Name": "identifier", - "Type": "System.String" - }, - { - "Name": "existingIdentifiers", - "Type": "System.Collections.Generic.ICollection" - }, - { - "Name": "uniquifier", - "Type": "System.Func, System.String>" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Uniquifier", - "Parameters": [ - { - "Name": "proposedIdentifier", - "Type": "System.String" - }, - { - "Name": "existingIdentifiers", - "Type": "System.Collections.Generic.ICollection" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GetTypeName", - "Parameters": [ - { - "Name": "propertyType", - "Type": "System.Type" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "IsValidIdentifier", - "Parameters": [ - { - "Name": "name", - "Type": "System.String" - } - ], - "ReturnType": "System.Boolean", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.EntityFrameworkCore.Scaffolding.Internal.DbDataReaderExtension", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "Static": true, - "Sealed": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "GetValueOrDefault", - "Parameters": [ - { - "Name": "reader", - "Type": "System.Data.Common.DbDataReader" - }, - { - "Name": "name", - "Type": "System.String" - } - ], - "ReturnType": "T0", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [ - { - "ParameterName": "T", - "ParameterPosition": 0, - "BaseTypeOrInterfaces": [] - } - ] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.EntityFrameworkCore.Scaffolding.Internal.IInternalDatabaseModelFactory", - "Visibility": "Public", - "Kind": "Interface", - "Abstract": true, - "ImplementedInterfaces": [ - "Microsoft.EntityFrameworkCore.Scaffolding.IDatabaseModelFactory" - ], - "Members": [ - { - "Kind": "Method", - "Name": "Create", - "Parameters": [ - { - "Name": "connection", - "Type": "System.Data.Common.DbConnection" - }, - { - "Name": "tableSelectionSet", - "Type": "Microsoft.EntityFrameworkCore.Scaffolding.TableSelectionSet" - } - ], - "ReturnType": "Microsoft.EntityFrameworkCore.Scaffolding.Metadata.DatabaseModel", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.EntityFrameworkCore.Scaffolding.TableSelectionSet+Selection", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Text", - "Parameters": [], - "ReturnType": "System.String", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_IsMatched", - "Parameters": [], - "ReturnType": "System.Boolean", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_IsMatched", - "Parameters": [ - { - "Name": "value", - "Type": "System.Boolean" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "selectionText", - "Type": "System.String" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - } - ] -} \ No newline at end of file diff --git a/src/EFCore.Relational.Design/breakingchanges.netcore.json b/src/EFCore.Relational.Design/breakingchanges.netcore.json deleted file mode 100644 index 7005832f91..0000000000 --- a/src/EFCore.Relational.Design/breakingchanges.netcore.json +++ /dev/null @@ -1,73 +0,0 @@ -[ - { - "TypeId": "public enum Microsoft.EntityFrameworkCore.Infrastructure.RelationalDesignEventId", - "Kind": "Removal" - }, - { - "TypeId": "public class Microsoft.EntityFrameworkCore.Scaffolding.RelationalScaffoldingModelFactory : Microsoft.EntityFrameworkCore.Scaffolding.IScaffoldingModelFactory", - "MemberId": "protected virtual Microsoft.Extensions.Logging.ILogger get_Logger()", - "Kind": "Removal" - }, - { - "TypeId": "public class Microsoft.EntityFrameworkCore.Scaffolding.RelationalScaffoldingModelFactory : Microsoft.EntityFrameworkCore.Scaffolding.IScaffoldingModelFactory", - "MemberId": "public .ctor(Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, Microsoft.EntityFrameworkCore.Storage.IRelationalTypeMapper typeMapper, Microsoft.EntityFrameworkCore.Scaffolding.IDatabaseModelFactory databaseModelFactory, Microsoft.EntityFrameworkCore.Scaffolding.Internal.CandidateNamingService candidateNamingService)", - "Kind": "Removal" - }, - { - "TypeId": "public class Microsoft.EntityFrameworkCore.Scaffolding.Metadata.ColumnModel : Microsoft.EntityFrameworkCore.Infrastructure.Annotatable", - "Kind": "Removal" - }, - { - "TypeId": "public class Microsoft.EntityFrameworkCore.Scaffolding.Metadata.DatabaseModel : Microsoft.EntityFrameworkCore.Infrastructure.Annotatable", - "Kind": "Removal" - }, - { - "TypeId": "public class Microsoft.EntityFrameworkCore.Scaffolding.Metadata.ForeignKeyColumnModel : Microsoft.EntityFrameworkCore.Infrastructure.Annotatable", - "Kind": "Removal" - }, - { - "TypeId": "public class Microsoft.EntityFrameworkCore.Scaffolding.Metadata.ForeignKeyModel : Microsoft.EntityFrameworkCore.Infrastructure.Annotatable", - "Kind": "Removal" - }, - { - "TypeId": "public class Microsoft.EntityFrameworkCore.Scaffolding.Metadata.IndexColumnModel : Microsoft.EntityFrameworkCore.Infrastructure.Annotatable", - "Kind": "Removal" - }, - { - "TypeId": "public class Microsoft.EntityFrameworkCore.Scaffolding.Metadata.IndexModel : Microsoft.EntityFrameworkCore.Infrastructure.Annotatable", - "Kind": "Removal" - }, - { - "TypeId": "public class Microsoft.EntityFrameworkCore.Scaffolding.Metadata.ScaffoldingModelAnnotations : Microsoft.EntityFrameworkCore.Metadata.RelationalModelAnnotations", - "Kind": "Removal" - }, - { - "TypeId": "public class Microsoft.EntityFrameworkCore.Scaffolding.Metadata.ScaffoldingPropertyAnnotations : Microsoft.EntityFrameworkCore.Metadata.RelationalPropertyAnnotations", - "Kind": "Removal" - }, - { - "TypeId": "public class Microsoft.EntityFrameworkCore.Scaffolding.Metadata.SequenceModel : Microsoft.EntityFrameworkCore.Infrastructure.Annotatable", - "Kind": "Removal" - }, - { - "TypeId": "public class Microsoft.EntityFrameworkCore.Scaffolding.Metadata.TableModel : Microsoft.EntityFrameworkCore.Infrastructure.Annotatable", - "Kind": "Removal" - }, - { - "TypeId": "public class Microsoft.EntityFrameworkCore.Scaffolding.ScaffoldingTypeMapper", - "Kind": "Removal" - }, - { - "TypeId": "public class Microsoft.EntityFrameworkCore.Scaffolding.TypeScaffoldingInfo", - "Kind": "Removal" - }, - { - "TypeId": "public static class Microsoft.EntityFrameworkCore.Metadata.ScaffoldingMetadataExtensions", - "Kind": "Removal" - }, - { - "TypeId": "public class Microsoft.EntityFrameworkCore.Scaffolding.RelationalScaffoldingModelFactory : Microsoft.EntityFrameworkCore.Scaffolding.IScaffoldingModelFactory", - "MemberId": "protected virtual Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapping GetTypeMapping(Microsoft.EntityFrameworkCore.Scaffolding.Metadata.ColumnModel column)", - "Kind": "Removal" - } -] \ No newline at end of file diff --git a/src/EFCore.Relational.Specification.Tests/EFCore.Relational.Specification.Tests.csproj b/src/EFCore.Relational.Specification.Tests/EFCore.Relational.Specification.Tests.csproj index e43d343bae..d855371a04 100644 --- a/src/EFCore.Relational.Specification.Tests/EFCore.Relational.Specification.Tests.csproj +++ b/src/EFCore.Relational.Specification.Tests/EFCore.Relational.Specification.Tests.csproj @@ -15,7 +15,6 @@ - diff --git a/src/EFCore.Relational/Diagnostics/RelationalEventId.cs b/src/EFCore.Relational/Diagnostics/RelationalEventId.cs index 99b8ab29fc..c3c021179b 100644 --- a/src/EFCore.Relational/Diagnostics/RelationalEventId.cs +++ b/src/EFCore.Relational/Diagnostics/RelationalEventId.cs @@ -62,7 +62,32 @@ namespace Microsoft.EntityFrameworkCore.Diagnostics // Model validation events ModelValidationKeyDefaultValueWarning = CoreEventId.RelationalBaseId + 600, - BoolWithDefaultWarning + BoolWithDefaultWarning, + + // Scaffolding warning events + MissingTableWarning = CoreEventId.CoreDesignBaseId + 700, + SequenceNotNamedWarning, + IndexColumnsNotMappedWarning, + ForeignKeyReferencesMissingTableWarning, + ForeignKeyReferencesMissingPrincipalTableWarning, + ForeignKeyColumnsNotMappedWarning, + ForeignKeyNotNamedWarning, + ForeignKeyColumnMissingWarning, + ForeignKeyColumnNotNamedWarning, + ForeignKeyPrincipalColumnMissingWarning, + ColumnNotNamedWarning, + IndexNotNamedWarning, + IndexTableMissingWarning, + IndexColumnNotNamedWarning, + + // Scaffolding events + TableFound = CoreEventId.CoreDesignBaseId + 800, + TableSkipped, + ColumnSkipped, + IndexFound, + IndexColumnFound, + IndexColumnSkipped, + SequenceFound } private static readonly string _connectionPrefix = DbLoggerCategory.Database.Connection.Name + "."; @@ -434,5 +459,134 @@ namespace Microsoft.EntityFrameworkCore.Diagnostics /// /// public static readonly EventId BoolWithDefaultWarning = MakeValidationId(Id.BoolWithDefaultWarning); + + private static readonly string _scaffoldingPrefix = DbLoggerCategory.Scaffolding.Name + "."; + private static EventId MakeScaffoldingId(Id id) => new EventId((int)id, _scaffoldingPrefix + id); + + /// + /// The database is missing a table. + /// This event is in the category. + /// + public static readonly EventId MissingTableWarning = MakeScaffoldingId(Id.MissingTableWarning); + + /// + /// The database has an unnamed sequence. + /// This event is in the category. + /// + public static readonly EventId SequenceNotNamedWarning = MakeScaffoldingId(Id.SequenceNotNamedWarning); + + /// + /// Columns in an index were not mapped. + /// This event is in the category. + /// + public static readonly EventId IndexColumnsNotMappedWarning = MakeScaffoldingId(Id.IndexColumnsNotMappedWarning); + + /// + /// A foreign key references a missing table. + /// This event is in the category. + /// + public static readonly EventId ForeignKeyReferencesMissingTableWarning = MakeScaffoldingId(Id.ForeignKeyReferencesMissingTableWarning); + + /// + /// A foreign key references a missing table at the principal end. + /// This event is in the category. + /// + public static readonly EventId ForeignKeyReferencesMissingPrincipalTableWarning = MakeScaffoldingId(Id.ForeignKeyReferencesMissingPrincipalTableWarning); + + /// + /// Columns in a foreign key were not mapped. + /// This event is in the category. + /// + public static readonly EventId ForeignKeyColumnsNotMappedWarning = MakeScaffoldingId(Id.ForeignKeyColumnsNotMappedWarning); + + /// + /// A foreign key is not named. + /// This event is in the category. + /// + public static readonly EventId ForeignKeyNotNamedWarning = MakeScaffoldingId(Id.ForeignKeyNotNamedWarning); + + /// + /// A foreign key column was not found. + /// This event is in the category. + /// + public static readonly EventId ForeignKeyColumnMissingWarning = MakeScaffoldingId(Id.ForeignKeyColumnMissingWarning); + + /// + /// A column referenced by a foreign key constraint was not found. + /// This event is in the category. + /// + public static readonly EventId ForeignKeyPrincipalColumnMissingWarning = MakeScaffoldingId(Id.ForeignKeyPrincipalColumnMissingWarning); + + /// + /// A foreign key column was not named. + /// This event is in the category. + /// + public static readonly EventId ForeignKeyColumnNotNamedWarning = MakeScaffoldingId(Id.ForeignKeyColumnNotNamedWarning); + + /// + /// A column is not named. + /// This event is in the category. + /// + public static readonly EventId ColumnNotNamedWarning = MakeScaffoldingId(Id.ColumnNotNamedWarning); + + /// + /// An index is not named. + /// This event is in the category. + /// + public static readonly EventId IndexNotNamedWarning = MakeScaffoldingId(Id.IndexNotNamedWarning); + + /// + /// The table referened by an index was not found. + /// This event is in the category. + /// + public static readonly EventId IndexTableMissingWarning = MakeScaffoldingId(Id.IndexTableMissingWarning); + + /// + /// An index column was not named. + /// This event is in the category. + /// + public static readonly EventId IndexColumnNotNamedWarning = MakeScaffoldingId(Id.IndexColumnNotNamedWarning); + + /// + /// A table was found. + /// This event is in the category. + /// + public static readonly EventId TableFound = MakeScaffoldingId(Id.TableFound); + + /// + /// A table was skipped. + /// This event is in the category. + /// + public static readonly EventId TableSkipped = MakeScaffoldingId(Id.TableSkipped); + + /// + /// A column was skipped. + /// This event is in the category. + /// + public static readonly EventId ColumnSkipped = MakeScaffoldingId(Id.ColumnSkipped); + + /// + /// An index was found. + /// This event is in the category. + /// + public static readonly EventId IndexFound = MakeScaffoldingId(Id.IndexFound); + + /// + /// An index was skipped. + /// This event is in the category. + /// + public static readonly EventId IndexColumnFound = MakeScaffoldingId(Id.IndexColumnFound); + + /// + /// A column of an index was skipped. + /// This event is in the category. + /// + public static readonly EventId IndexColumnSkipped = MakeScaffoldingId(Id.IndexColumnSkipped); + + /// + /// A sequence was found. + /// This event is in the category. + /// + public static readonly EventId SequenceFound = MakeScaffoldingId(Id.SequenceFound); } } diff --git a/src/EFCore.Relational/Internal/RelationalLoggerExtensions.cs b/src/EFCore.Relational/Internal/RelationalLoggerExtensions.cs index 74fa425c9d..d2f5e99666 100644 --- a/src/EFCore.Relational/Internal/RelationalLoggerExtensions.cs +++ b/src/EFCore.Relational/Internal/RelationalLoggerExtensions.cs @@ -2,9 +2,12 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Collections.Generic; using System.Data; using System.Data.Common; +using System.Diagnostics; using System.Globalization; +using System.Linq; using System.Linq.Expressions; using JetBrains.Annotations; using Microsoft.EntityFrameworkCore.Diagnostics; @@ -14,6 +17,7 @@ using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations.Internal; using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Storage.Internal; +using Microsoft.Extensions.Logging; using Remotion.Linq; namespace Microsoft.EntityFrameworkCore.Internal @@ -1116,5 +1120,559 @@ namespace Microsoft.EntityFrameworkCore.Internal var p = (PropertyEventData)payload; return d.GenerateMessage(p.Property.Name, p.Property.DeclaringEntityType.DisplayName()); } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void MissingTableWarning( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string tableName) + { + var definition = RelationalStrings.LogMissingTable; + + definition.Log(diagnostics, tableName); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + TableName = tableName + }); + } + } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void SequenceNotNamedWarning( + [NotNull] this IDiagnosticsLogger diagnostics) + { + var definition = RelationalStrings.LogSequencesRequireName; + + definition.Log(diagnostics); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write(definition.EventId.Name, null); + } + } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void IndexColumnsNotMappedWarning( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string indexName, + [NotNull] IList unmappedColumnNames) + { + var definition = RelationalStrings.LogUnableToScaffoldIndexMissingProperty; + + definition.Log( + diagnostics, + indexName, + string.Join(CultureInfo.CurrentCulture.TextInfo.ListSeparator, unmappedColumnNames)); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + IndexName = indexName, + UnmappedColumnNames = unmappedColumnNames + }); + } + } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void ForeignKeyReferencesMissingTableWarning( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string foreignKeyName) + { + var definition = RelationalStrings.LogForeignKeyScaffoldErrorPrincipalTableNotFound; + + definition.Log(diagnostics, foreignKeyName); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + ForeignKeyName = foreignKeyName + }); + } + } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void ForeignKeyColumnsNotMappedWarning( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string foreignKeyName, + [NotNull] IList unmappedColumnNames) + { + var definition = RelationalStrings.LogForeignKeyScaffoldErrorPropertyNotFound; + + definition.Log( + diagnostics, + foreignKeyName, + string.Join(CultureInfo.CurrentCulture.TextInfo.ListSeparator, unmappedColumnNames)); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + ForeignKeyName = foreignKeyName, + UnmappedColumnNames = unmappedColumnNames + }); + } + } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void SequenceFound( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string sequenceName, + [CanBeNull] string sequenceTypeName, + bool? cyclic, + int? increment, + long? start, + long? min, + long? max) + { + var definition = RelationalStrings.LogFoundSequence; + + Debug.Assert(LogLevel.Debug == definition.Level); + + if (diagnostics.GetLogBehavior(definition.EventId, definition.Level) != WarningBehavior.Ignore) + { + definition.Log( + diagnostics, + l => l.LogDebug( + definition.EventId, + null, + definition.MessageFormat, + sequenceName, + sequenceTypeName, + cyclic, + increment, + start, + min, + max)); + } + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + SequenceName = sequenceName, + SequenceTypeName = sequenceTypeName, + Cyclic = cyclic, + Increment = increment, + Start = start, + Min = min, + Max = max + }); + } + } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void TableFound( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string tableName) + { + var definition = RelationalStrings.LogFoundTable; + + definition.Log(diagnostics, tableName); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + TableName = tableName + }); + } + } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void TableSkipped( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string tableName) + { + var definition = RelationalStrings.LogTableNotInSelectionSet; + + definition.Log(diagnostics, tableName); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + TableName = tableName + }); + } + } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void ColumnSkipped( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string tableName, + [CanBeNull] string columnName) + { + var definition = RelationalStrings.LogColumnNotInSelectionSet; + + definition.Log(diagnostics, columnName, tableName); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + TableName = tableName, + ColumnName = columnName + }); + } + } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void IndexColumnFound( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string tableName, + [CanBeNull] string indexName, + bool? unique, + [CanBeNull] string columnName, + int? ordinal) + { + var definition = RelationalStrings.LogFoundIndexColumn; + + definition.Log(diagnostics, indexName, tableName, columnName, ordinal); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + TableName = tableName, + IndexName = indexName, + Unique = unique, + ColumnName = columnName, + Ordinal = ordinal + }); + } + } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void ColumnNotNamedWarning( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string tableName) + { + var definition = RelationalStrings.LogColumnNameEmptyOnTable; + + definition.Log(diagnostics, tableName); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + TableName = tableName + }); + } + } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void IndexColumnSkipped( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string tableName, + [CanBeNull] string indexName, + [CanBeNull] string columnName) + { + var definition = RelationalStrings.LogIndexColumnNotInSelectionSet; + + definition.Log(diagnostics, columnName, indexName, tableName); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + TableName = tableName, + IndexName = indexName, + ColumnName = columnName + }); + } + } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void IndexNotNamedWarning( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string tableName) + { + var definition = RelationalStrings.LogIndexNameEmpty; + + definition.Log(diagnostics, tableName); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + TableName = tableName + }); + } + } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void IndexTableMissingWarning( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string indexName, + [CanBeNull] string tableName) + { + var definition = RelationalStrings.LogUnableToFindTableForIndex; + + definition.Log(diagnostics, indexName, tableName); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + IndexName = indexName, + TableName = tableName + }); + } + } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void IndexColumnNotNamedWarning( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string indexName, + [CanBeNull] string tableName) + { + var definition = RelationalStrings.LogColumnNameEmptyOnIndex; + + definition.Log(diagnostics, indexName, tableName); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + IndexName = indexName, + TableName = tableName + }); + } + } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void ForeignKeyNotNamedWarning( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string tableName) + { + var definition = RelationalStrings.LogForeignKeyNameEmpty; + + definition.Log(diagnostics, tableName); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + TableName = tableName + }); + } + } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void ForeignKeyColumnMissingWarning( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string columnName, + [CanBeNull] string foreignKeyName, + [CanBeNull] string tableName) + { + var definition = RelationalStrings.LogForeignKeyColumnNotInSelectionSet; + + definition.Log(diagnostics, columnName, foreignKeyName, tableName); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + ColumnName = columnName, + ForeignKeyName = foreignKeyName, + TableName = tableName + }); + } + } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void ForeignKeyReferencesMissingPrincipalTableWarning( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string foreignKeyName, + [CanBeNull] string tableName, + [CanBeNull] string principalTableName) + { + var definition = RelationalStrings.LogPrincipalTableNotInSelectionSet; + + definition.Log(diagnostics, foreignKeyName, tableName, principalTableName); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + ForeignKeyName = foreignKeyName, + TableName = tableName, + PrincipalTableName = principalTableName + }); + } + } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void ForeignKeyColumnNotNamedWarning( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string foreignKeyName, + [CanBeNull] string tableName) + { + var definition = RelationalStrings.LogColumnNameEmptyOnForeignKey; + + definition.Log(diagnostics, tableName, foreignKeyName); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + ForeignKeyName = foreignKeyName, + TableName = tableName + }); + } + } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void IndexFound( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string indexName, + [CanBeNull] string tableName, + bool? unique) + { + var definition = RelationalStrings.LogFoundIndex; + + definition.Log(diagnostics, indexName, tableName, unique); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + IndexName = indexName, + TableName = tableName, + Unique = unique + }); + } + } + + /// + /// This API supports the Entity Framework Core infrastructure and is not intended to be used + /// directly from your code. This API may change or be removed in future releases. + /// + public static void ForeignKeyPrincipalColumnMissingWarning( + [NotNull] this IDiagnosticsLogger diagnostics, + [CanBeNull] string foreignKeyName, + [CanBeNull] string tableName, + [CanBeNull] string principalColumnName, + [CanBeNull] string principalTableName) + { + var definition = RelationalStrings.LogPrincipalColumnNotFound; + + definition.Log(diagnostics, foreignKeyName, tableName, principalColumnName, principalTableName); + + if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name)) + { + diagnostics.DiagnosticSource.Write( + definition.EventId.Name, + new + { + ForeignKeyName = foreignKeyName, + TableName = tableName, + PrincipalColumnName = principalColumnName, + PrincipalTableName = principalTableName + }); + } + } } } diff --git a/src/EFCore.Relational/Properties/RelationalStrings.Designer.cs b/src/EFCore.Relational/Properties/RelationalStrings.Designer.cs index 9bac13e410..c6bd12186d 100644 --- a/src/EFCore.Relational/Properties/RelationalStrings.Designer.cs +++ b/src/EFCore.Relational/Properties/RelationalStrings.Designer.cs @@ -770,6 +770,255 @@ namespace Microsoft.EntityFrameworkCore.Internal GetString("UnsupportedPropertyType", nameof(entity), nameof(property), nameof(clrType)), entity, property, clrType); + /// + /// Found sequence name: {name}, data type: {dataType}, cyclic: {isCyclic}, increment: {increment}, start: {start}, minimum: {min}, maximum: {max}. + /// + public static readonly FallbackEventDefinition LogFoundSequence + = new FallbackEventDefinition( + RelationalEventId.SequenceFound, + LogLevel.Debug, + _resourceManager.GetString("LogFoundSequence")); + + /// + /// Sequence name cannot be null or empty. Entity Framework cannot model a sequence that does not have a name. + /// + public static readonly EventDefinition LogSequencesRequireName + = new EventDefinition( + RelationalEventId.SequenceNotNamedWarning, + LogLevel.Warning, + LoggerMessage.Define( + LogLevel.Warning, + RelationalEventId.SequenceNotNamedWarning, + _resourceManager.GetString("LogSequencesRequireName"))); + + /// + /// Found table with name: {name}. + /// + public static readonly EventDefinition LogFoundTable + = new EventDefinition( + RelationalEventId.TableFound, + LogLevel.Debug, + LoggerMessage.Define( + LogLevel.Debug, + RelationalEventId.TableFound, + _resourceManager.GetString("LogFoundTable"))); + + /// + /// Table {tableName} is not included in the selection set. Skipping. + /// + public static readonly EventDefinition LogTableNotInSelectionSet + = new EventDefinition( + RelationalEventId.TableSkipped, + LogLevel.Debug, + LoggerMessage.Define( + LogLevel.Debug, + RelationalEventId.TableSkipped, + _resourceManager.GetString("LogTableNotInSelectionSet"))); + + /// + /// Column {columnName} belongs to table {tableName} which is not included in the selection set. Skipping. + /// + public static readonly EventDefinition LogColumnNotInSelectionSet + = new EventDefinition( + RelationalEventId.ColumnSkipped, + LogLevel.Debug, + LoggerMessage.Define( + LogLevel.Debug, + RelationalEventId.ColumnSkipped, + _resourceManager.GetString("LogColumnNotInSelectionSet"))); + + /// + /// Found a column on table {tableName} with an empty or null name. Skipping column. + /// + public static readonly EventDefinition LogColumnNameEmptyOnTable + = new EventDefinition( + RelationalEventId.ColumnNotNamedWarning, + LogLevel.Warning, + LoggerMessage.Define( + LogLevel.Warning, + RelationalEventId.ColumnNotNamedWarning, + _resourceManager.GetString("LogColumnNameEmptyOnTable"))); + + /// + /// Unable to find a table in the database matching the selected table {table}. + /// + public static readonly EventDefinition LogMissingTable + = new EventDefinition( + RelationalEventId.MissingTableWarning, + LogLevel.Warning, + LoggerMessage.Define( + LogLevel.Warning, + RelationalEventId.MissingTableWarning, + _resourceManager.GetString("LogMissingTable"))); + + /// + /// Found index column on index {indexName} on table {tableName}, column name: {columnName}, ordinal: {ordinal}. + /// + public static readonly EventDefinition LogFoundIndexColumn + = new EventDefinition( + RelationalEventId.IndexColumnFound, + LogLevel.Debug, + LoggerMessage.Define( + LogLevel.Debug, + RelationalEventId.IndexColumnFound, + _resourceManager.GetString("LogFoundIndexColumn"))); + + /// + /// Index column {columnName} belongs to index {indexName} on table {tableName} which is not included in the selection set. Skipping. + /// + public static readonly EventDefinition LogIndexColumnNotInSelectionSet + = new EventDefinition( + RelationalEventId.IndexColumnSkipped, + LogLevel.Warning, + LoggerMessage.Define( + LogLevel.Warning, + RelationalEventId.IndexColumnSkipped, + _resourceManager.GetString("LogIndexColumnNotInSelectionSet"))); + + /// + /// Found an index on table {tableName} with an empty or null name. Skipping index. + /// + public static readonly EventDefinition LogIndexNameEmpty + = new EventDefinition( + RelationalEventId.IndexNotNamedWarning, + LogLevel.Warning, + LoggerMessage.Define( + LogLevel.Warning, + RelationalEventId.IndexNotNamedWarning, + _resourceManager.GetString("LogIndexNameEmpty"))); + + /// + /// For index {indexName}. Unable to find parent table {tableName}. Skipping index. + /// + public static readonly EventDefinition LogUnableToFindTableForIndex + = new EventDefinition( + RelationalEventId.IndexTableMissingWarning, + LogLevel.Warning, + LoggerMessage.Define( + LogLevel.Warning, + RelationalEventId.IndexTableMissingWarning, + _resourceManager.GetString("LogUnableToFindTableForIndex"))); + + /// + /// Found a column on index {indexName} on table {tableName} with an empty or null name. Not including column in index. + /// + public static readonly EventDefinition LogColumnNameEmptyOnIndex + = new EventDefinition( + RelationalEventId.IndexColumnNotNamedWarning, + LogLevel.Warning, + LoggerMessage.Define( + LogLevel.Warning, + RelationalEventId.IndexColumnNotNamedWarning, + _resourceManager.GetString("LogColumnNameEmptyOnIndex"))); + + /// + /// Unable to scaffold the index '{indexName}'. The following columns could not be scaffolded: {columnNames}. + /// + public static readonly EventDefinition LogUnableToScaffoldIndexMissingProperty + = new EventDefinition( + RelationalEventId.IndexColumnsNotMappedWarning, + LogLevel.Warning, + LoggerMessage.Define( + LogLevel.Warning, + RelationalEventId.IndexColumnsNotMappedWarning, + _resourceManager.GetString("LogUnableToScaffoldIndexMissingProperty"))); + + /// + /// Found a foreign key on table {tableName} with an empty or null name. Skipping foreign key. + /// + public static readonly EventDefinition LogForeignKeyNameEmpty + = new EventDefinition( + RelationalEventId.ForeignKeyNotNamedWarning, + LogLevel.Warning, + LoggerMessage.Define( + LogLevel.Warning, + RelationalEventId.ForeignKeyNotNamedWarning, + _resourceManager.GetString("LogForeignKeyNameEmpty"))); + + /// + /// Foreign key column {columnName} belongs to foreign key {fkName} on table {tableName} which is not included in the selection set. Skipping. + /// + public static readonly EventDefinition LogForeignKeyColumnNotInSelectionSet + = new EventDefinition( + RelationalEventId.ForeignKeyColumnMissingWarning, + LogLevel.Warning, + LoggerMessage.Define( + LogLevel.Warning, + RelationalEventId.ForeignKeyColumnMissingWarning, + _resourceManager.GetString("LogForeignKeyColumnNotInSelectionSet"))); + + /// + /// For foreign key {fkName} on table {tableName}, unable to model the end of the foreign key on principal table {principaltableName}. This is usually because the principal table was not included in the selection set. + /// + public static readonly EventDefinition LogPrincipalTableNotInSelectionSet + = new EventDefinition( + RelationalEventId.ForeignKeyReferencesMissingPrincipalTableWarning, + LogLevel.Warning, + LoggerMessage.Define( + LogLevel.Warning, + RelationalEventId.ForeignKeyReferencesMissingPrincipalTableWarning, + _resourceManager.GetString("LogPrincipalTableNotInSelectionSet"))); + + /// + /// Found a column on foreign key {tableName}.{fkName} with an empty or null name. Not including column in foreign key + /// + public static readonly EventDefinition LogColumnNameEmptyOnForeignKey + = new EventDefinition( + RelationalEventId.ForeignKeyColumnNotNamedWarning, + LogLevel.Warning, + LoggerMessage.Define( + LogLevel.Warning, + RelationalEventId.ForeignKeyColumnNotNamedWarning, + _resourceManager.GetString("LogColumnNameEmptyOnForeignKey"))); + + /// + /// Could not scaffold the foreign key '{foreignKeyName}'. The following columns in the foreign key could not be scaffolded: {columnNames}. + /// + public static readonly EventDefinition LogForeignKeyScaffoldErrorPropertyNotFound + = new EventDefinition( + RelationalEventId.ForeignKeyColumnsNotMappedWarning, + LogLevel.Warning, + LoggerMessage.Define( + LogLevel.Warning, + RelationalEventId.ForeignKeyColumnsNotMappedWarning, + _resourceManager.GetString("LogForeignKeyScaffoldErrorPropertyNotFound"))); + + /// + /// Found index with name: {indexName}, table: {tableName}, is unique: {isUnique}. + /// + public static readonly EventDefinition LogFoundIndex + = new EventDefinition( + RelationalEventId.IndexFound, + LogLevel.Debug, + LoggerMessage.Define( + LogLevel.Debug, + RelationalEventId.IndexFound, + _resourceManager.GetString("LogFoundIndex"))); + + /// + /// Could not scaffold the foreign key '{foreignKeyName}'. The referenced table could not be found. This most likely occurred because the referenced table was excluded from scaffolding. + /// + public static readonly EventDefinition LogForeignKeyScaffoldErrorPrincipalTableNotFound + = new EventDefinition( + RelationalEventId.ForeignKeyReferencesMissingTableWarning, + LogLevel.Warning, + LoggerMessage.Define( + LogLevel.Warning, + RelationalEventId.ForeignKeyReferencesMissingTableWarning, + _resourceManager.GetString("LogForeignKeyScaffoldErrorPrincipalTableNotFound"))); + + /// + /// For foreign key with identity {id} on table {tableName}, unable to find the column called {principalColumnName} on the foreign key's principal table, {principaltableName}. Skipping foreign key. + /// + public static readonly EventDefinition LogPrincipalColumnNotFound + = new EventDefinition( + RelationalEventId.ForeignKeyPrincipalColumnMissingWarning, + LogLevel.Warning, + LoggerMessage.Define( + LogLevel.Warning, + RelationalEventId.ForeignKeyPrincipalColumnMissingWarning, + _resourceManager.GetString("LogPrincipalColumnNotFound"))); + private static string GetString(string name, params string[] formatterNames) { var value = _resourceManager.GetString(name); diff --git a/src/EFCore.Relational/Properties/RelationalStrings.resx b/src/EFCore.Relational/Properties/RelationalStrings.resx index b287cf4aea..d066df6847 100644 --- a/src/EFCore.Relational/Properties/RelationalStrings.resx +++ b/src/EFCore.Relational/Properties/RelationalStrings.resx @@ -396,4 +396,89 @@ No mapping to a relational type can be found for property '{entity}.{property}' with the CLR type '{clrType}'. + + Found sequence name: {name}, data type: {dataType}, cyclic: {isCyclic}, increment: {increment}, start: {start}, minimum: {min}, maximum: {max}. + Debug RelationalEventId.SequenceFound string string bool? int? long? long? long? + + + Sequence name cannot be null or empty. Entity Framework cannot model a sequence that does not have a name. + Warning RelationalEventId.SequenceNotNamedWarning + + + Found table with name: {name}. + Debug RelationalEventId.TableFound string + + + Table {tableName} is not included in the selection set. Skipping. + Debug RelationalEventId.TableSkipped string + + + Column {columnName} belongs to table {tableName} which is not included in the selection set. Skipping. + Debug RelationalEventId.ColumnSkipped string string + + + Found a column on table {tableName} with an empty or null name. Skipping column. + Warning RelationalEventId.ColumnNotNamedWarning string + + + Unable to find a table in the database matching the selected table {table}. + Warning RelationalEventId.MissingTableWarning string + + + Found index column on index {indexName} on table {tableName}, column name: {columnName}, ordinal: {ordinal}. + Debug RelationalEventId.IndexColumnFound string string string int? + + + Index column {columnName} belongs to index {indexName} on table {tableName} which is not included in the selection set. Skipping. + Warning RelationalEventId.IndexColumnSkipped string string string + + + Found an index on table {tableName} with an empty or null name. Skipping index. + Warning RelationalEventId.IndexNotNamedWarning string + + + For index {indexName}. Unable to find parent table {tableName}. Skipping index. + Warning RelationalEventId.IndexTableMissingWarning string string + + + Found a column on index {indexName} on table {tableName} with an empty or null name. Not including column in index. + Warning RelationalEventId.IndexColumnNotNamedWarning string string + + + Unable to scaffold the index '{indexName}'. The following columns could not be scaffolded: {columnNames}. + Warning RelationalEventId.IndexColumnsNotMappedWarning string string + + + Found a foreign key on table {tableName} with an empty or null name. Skipping foreign key. + Warning RelationalEventId.ForeignKeyNotNamedWarning string + + + Foreign key column {columnName} belongs to foreign key {fkName} on table {tableName} which is not included in the selection set. Skipping. + Warning RelationalEventId.ForeignKeyColumnMissingWarning string string string + + + For foreign key {fkName} on table {tableName}, unable to model the end of the foreign key on principal table {principaltableName}. This is usually because the principal table was not included in the selection set. + Warning RelationalEventId.ForeignKeyReferencesMissingPrincipalTableWarning string string string + + + Found a column on foreign key {tableName}.{fkName} with an empty or null name. Not including column in foreign key + Warning RelationalEventId.ForeignKeyColumnNotNamedWarning string string + + + Could not scaffold the foreign key '{foreignKeyName}'. The following columns in the foreign key could not be scaffolded: {columnNames}. + Warning RelationalEventId.ForeignKeyColumnsNotMappedWarning string string + + + Found index with name: {indexName}, table: {tableName}, is unique: {isUnique}. + Debug RelationalEventId.IndexFound string string bool? + + + Could not scaffold the foreign key '{foreignKeyName}'. The referenced table could not be found. This most likely occurred because the referenced table was excluded from scaffolding. + Warning RelationalEventId.ForeignKeyReferencesMissingTableWarning string + + + For foreign key with identity {id} on table {tableName}, unable to find the column called {principalColumnName} on the foreign key's principal table, {principaltableName}. Skipping foreign key. + Warning RelationalEventId.ForeignKeyPrincipalColumnMissingWarning string string string string + + \ No newline at end of file diff --git a/src/EFCore.Relational.Design/Internal/DbDataReaderExtension.cs b/src/EFCore.Relational/Scaffolding/DbDataReaderExtension.cs similarity index 100% rename from src/EFCore.Relational.Design/Internal/DbDataReaderExtension.cs rename to src/EFCore.Relational/Scaffolding/DbDataReaderExtension.cs diff --git a/src/EFCore.Relational.Design/IDatabaseModelFactory.cs b/src/EFCore.Relational/Scaffolding/IDatabaseModelFactory.cs similarity index 100% rename from src/EFCore.Relational.Design/IDatabaseModelFactory.cs rename to src/EFCore.Relational/Scaffolding/IDatabaseModelFactory.cs diff --git a/src/EFCore.Relational.Design/TableSelectionSet.cs b/src/EFCore.Relational/Scaffolding/TableSelectionSet.cs similarity index 100% rename from src/EFCore.Relational.Design/TableSelectionSet.cs rename to src/EFCore.Relational/Scaffolding/TableSelectionSet.cs diff --git a/src/EFCore.SqlServer/EFCore.SqlServer.csproj b/src/EFCore.SqlServer/EFCore.SqlServer.csproj index a7e038ef3f..e63aa530be 100644 --- a/src/EFCore.SqlServer/EFCore.SqlServer.csproj +++ b/src/EFCore.SqlServer/EFCore.SqlServer.csproj @@ -18,7 +18,6 @@ - diff --git a/src/EFCore.SqlServer/Scaffolding/Internal/SqlServerScaffoldingHelper.cs b/src/EFCore.SqlServer/Scaffolding/Internal/SqlServerScaffoldingHelper.cs index 4afca4493e..c0bcffa157 100644 --- a/src/EFCore.SqlServer/Scaffolding/Internal/SqlServerScaffoldingHelper.cs +++ b/src/EFCore.SqlServer/Scaffolding/Internal/SqlServerScaffoldingHelper.cs @@ -21,7 +21,7 @@ namespace Microsoft.EntityFrameworkCore.Scaffolding.Internal public virtual string GetProviderOptionsBuilder(string connectionString) { - return $"{nameof(SqlServerDbContextOptionsExtensions.UseSqlServer)}({CSharpUtilities.Instance.GenerateVerbatimStringLiteral(connectionString)});"; + return $"{nameof(SqlServerDbContextOptionsExtensions.UseSqlServer)}({GenerateVerbatimStringLiteral(connectionString)});"; } public virtual TypeScaffoldingInfo GetTypeScaffoldingInfo(ColumnModel columnModel) @@ -52,5 +52,7 @@ namespace Microsoft.EntityFrameworkCore.Scaffolding.Internal } private static string SchemaQualifiedKey(string name, string schema = null) => "[" + (schema ?? "") + "].[" + name + "]"; + + private static string GenerateVerbatimStringLiteral(string value) => "@\"" + value.Replace("\"", "\"\"") + "\""; } } diff --git a/src/EFCore.Sqlite.Core/EFCore.Sqlite.Core.csproj b/src/EFCore.Sqlite.Core/EFCore.Sqlite.Core.csproj index e52f229e13..797d331638 100644 --- a/src/EFCore.Sqlite.Core/EFCore.Sqlite.Core.csproj +++ b/src/EFCore.Sqlite.Core/EFCore.Sqlite.Core.csproj @@ -20,7 +20,6 @@ - diff --git a/src/EFCore.Sqlite.Core/Scaffolding/Internal/SqliteScaffoldingHelper.cs b/src/EFCore.Sqlite.Core/Scaffolding/Internal/SqliteScaffoldingHelper.cs index 26fdec85f8..3b8097cfc6 100644 --- a/src/EFCore.Sqlite.Core/Scaffolding/Internal/SqliteScaffoldingHelper.cs +++ b/src/EFCore.Sqlite.Core/Scaffolding/Internal/SqliteScaffoldingHelper.cs @@ -20,7 +20,7 @@ namespace Microsoft.EntityFrameworkCore.Scaffolding.Internal public virtual string GetProviderOptionsBuilder(string connectionString) { - return $"{nameof(SqliteDbContextOptionsBuilderExtensions.UseSqlite)}({CSharpUtilities.Instance.GenerateVerbatimStringLiteral(connectionString)});"; + return $"{nameof(SqliteDbContextOptionsBuilderExtensions.UseSqlite)}({GenerateVerbatimStringLiteral(connectionString)});"; } public virtual TypeScaffoldingInfo GetTypeScaffoldingInfo(ColumnModel columnModel) @@ -43,5 +43,7 @@ namespace Microsoft.EntityFrameworkCore.Scaffolding.Internal return typeScaffoldingInfo; } + + private static string GenerateVerbatimStringLiteral(string value) => "@\"" + value.Replace("\"", "\"\"") + "\""; } } diff --git a/src/EFCore/Diagnostics/CoreEventId.cs b/src/EFCore/Diagnostics/CoreEventId.cs index 7033f32fc0..635b34dfdd 100644 --- a/src/EFCore/Diagnostics/CoreEventId.cs +++ b/src/EFCore/Diagnostics/CoreEventId.cs @@ -33,11 +33,6 @@ namespace Microsoft.EntityFrameworkCore.Diagnostics /// public const int RelationalBaseId = 200000; - /// - /// The lower-bound for event IDs used by any relational database provider design-time and tooling. - /// - public const int RelationalDesignBaseId = 250000; - /// /// The lower-bound for event IDs used only by database providers. /// diff --git a/test/EFCore.Design.Tests/EFCore.Design.Tests.csproj b/test/EFCore.Design.Tests/EFCore.Design.Tests.csproj index 5818245c08..925e98ad91 100644 --- a/test/EFCore.Design.Tests/EFCore.Design.Tests.csproj +++ b/test/EFCore.Design.Tests/EFCore.Design.Tests.csproj @@ -19,7 +19,7 @@ - + diff --git a/test/EFCore.Relational.Design.Tests/CSharpNamerTest.cs b/test/EFCore.Design.Tests/Scaffolding/Internal/CSharpNamerTest.cs similarity index 100% rename from test/EFCore.Relational.Design.Tests/CSharpNamerTest.cs rename to test/EFCore.Design.Tests/Scaffolding/Internal/CSharpNamerTest.cs diff --git a/test/EFCore.Relational.Design.Tests/CSharpUniqueNamerTest.cs b/test/EFCore.Design.Tests/Scaffolding/Internal/CSharpUniqueNamerTest.cs similarity index 100% rename from test/EFCore.Relational.Design.Tests/CSharpUniqueNamerTest.cs rename to test/EFCore.Design.Tests/Scaffolding/Internal/CSharpUniqueNamerTest.cs diff --git a/test/EFCore.Relational.Design.Tests/CandidateNamingServiceTest.cs b/test/EFCore.Design.Tests/Scaffolding/Internal/CandidateNamingServiceTest.cs similarity index 100% rename from test/EFCore.Relational.Design.Tests/CandidateNamingServiceTest.cs rename to test/EFCore.Design.Tests/Scaffolding/Internal/CandidateNamingServiceTest.cs diff --git a/test/EFCore.Relational.Design.Tests/NullPluralizerTest.cs b/test/EFCore.Design.Tests/Scaffolding/Internal/NullPluralizerTest.cs similarity index 100% rename from test/EFCore.Relational.Design.Tests/NullPluralizerTest.cs rename to test/EFCore.Design.Tests/Scaffolding/Internal/NullPluralizerTest.cs diff --git a/test/EFCore.Relational.Design.Tests/RelationalScaffoldingModelFactoryTest.cs b/test/EFCore.Design.Tests/Scaffolding/Internal/RelationalScaffoldingModelFactoryTest.cs similarity index 99% rename from test/EFCore.Relational.Design.Tests/RelationalScaffoldingModelFactoryTest.cs rename to test/EFCore.Design.Tests/Scaffolding/Internal/RelationalScaffoldingModelFactoryTest.cs index cd385f2cd6..e87d68aa8c 100644 --- a/test/EFCore.Relational.Design.Tests/RelationalScaffoldingModelFactoryTest.cs +++ b/test/EFCore.Design.Tests/Scaffolding/Internal/RelationalScaffoldingModelFactoryTest.cs @@ -275,7 +275,7 @@ namespace Microsoft.EntityFrameworkCore }); Assert.Single(_factory.Create(info).FindEntityType("E").GetProperties()); - Assert.Single(_logger.Statements, t => t.Contains(RelationalDesignStrings.LogCannotFindTypeMappingForColumn.GenerateMessage("E.Coli", StoreType))); + Assert.Single(_logger.Statements, t => t.Contains(DesignStrings.LogCannotFindTypeMappingForColumn.GenerateMessage("E.Coli", StoreType))); } [Theory] @@ -611,7 +611,7 @@ namespace Microsoft.EntityFrameworkCore Assert.Single( _logger.Statements, t => t.Contains( "Warning: " + - RelationalDesignStrings.LogForeignKeyScaffoldErrorPrincipalKeyNotFound.GenerateMessage( + DesignStrings.LogForeignKeyScaffoldErrorPrincipalKeyNotFound.GenerateMessage( childrenTable.ForeignKeys.ElementAt(0).DisplayName, "NotPkId", "Parent"))); } @@ -712,7 +712,7 @@ namespace Microsoft.EntityFrameworkCore Assert.Single( _logger.Statements, t => t.Contains( "Warning: " + - RelationalDesignStrings.LogForeignKeyPrincipalEndContainsNullableColumns.GenerateMessage( + DesignStrings.LogForeignKeyPrincipalEndContainsNullableColumns.GenerateMessage( table.ForeignKeys.ElementAt(0).DisplayName, "FriendsNameUniqueIndex", "BuddyId"))); } diff --git a/test/EFCore.Relational.Design.Tests/ScaffoldingMetadataExtenstionsTest.cs b/test/EFCore.Design.Tests/Scaffolding/Internal/ScaffoldingMetadataExtenstionsTest.cs similarity index 100% rename from test/EFCore.Relational.Design.Tests/ScaffoldingMetadataExtenstionsTest.cs rename to test/EFCore.Design.Tests/Scaffolding/Internal/ScaffoldingMetadataExtenstionsTest.cs diff --git a/test/EFCore.Relational.Design.Tests/ApiConsistencyTest.cs b/test/EFCore.Relational.Design.Tests/ApiConsistencyTest.cs deleted file mode 100644 index b4a2ac45f0..0000000000 --- a/test/EFCore.Relational.Design.Tests/ApiConsistencyTest.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Reflection; -using Microsoft.EntityFrameworkCore.Scaffolding; - -namespace Microsoft.EntityFrameworkCore -{ - public class ApiConsistencyTest : ApiConsistencyTestBase - { - protected override Assembly TargetAssembly - => typeof(IScaffoldingModelFactory).GetTypeInfo().Assembly; - } -} diff --git a/test/EFCore.Relational.Design.Tests/EFCore.Relational.Design.Tests.csproj b/test/EFCore.Relational.Design.Tests/EFCore.Relational.Design.Tests.csproj deleted file mode 100644 index 1f84d2f452..0000000000 --- a/test/EFCore.Relational.Design.Tests/EFCore.Relational.Design.Tests.csproj +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - net461;netcoreapp2.0 - netcoreapp2.0 - Microsoft.EntityFrameworkCore.Relational.Design.Tests - Microsoft.EntityFrameworkCore - - - - - PreserveNewest - - - - - - - - - - - - - - - - - - - - - diff --git a/test/EFCore.Relational.Design.Tests/RelationalDesignEventIdTest.cs b/test/EFCore.Relational.Design.Tests/RelationalDesignEventIdTest.cs deleted file mode 100644 index 3f813dd0ed..0000000000 --- a/test/EFCore.Relational.Design.Tests/RelationalDesignEventIdTest.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore.Diagnostics; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Internal; -using Microsoft.EntityFrameworkCore.TestUtilities; -using Xunit; - -namespace Microsoft.EntityFrameworkCore -{ - public class RelationalDesignEventIdTest - { - [Fact] - public void Every_eventId_has_a_logger_method_and_logs_when_level_enabled() - { - var fakeFactories = new Dictionary> - { - { typeof(IList), () => new List { "A", "B" } }, - { typeof(string), () => "Fake" } - }; - - RelationalTestHelpers.Instance.TestEventLogging( - typeof(RelationalDesignEventId), - typeof(RelationalDesignLoggerExtensions), - fakeFactories); - } - } -} diff --git a/test/EFCore.Relational.Tests/RelationalEventIdTest.cs b/test/EFCore.Relational.Tests/RelationalEventIdTest.cs index d7ca6e1f56..2344090644 100644 --- a/test/EFCore.Relational.Tests/RelationalEventIdTest.cs +++ b/test/EFCore.Relational.Tests/RelationalEventIdTest.cs @@ -41,6 +41,7 @@ namespace Microsoft.EntityFrameworkCore var fakeFactories = new Dictionary> { { typeof(string), () => "Fake" }, + { typeof(IList), () => new List { "Fake1", "Fake2" } }, { typeof(IRelationalConnection), () => new FakeRelationalConnection() }, { typeof(DbCommand), () => new FakeDbCommand() }, { typeof(DbTransaction), () => new FakeDbTransaction() }, diff --git a/test/EFCore.SqlServer.Design.FunctionalTests/ReverseEngineering/SqlServerE2ETests.cs b/test/EFCore.SqlServer.Design.FunctionalTests/ReverseEngineering/SqlServerE2ETests.cs index 138038cf96..36bfcaefd8 100644 --- a/test/EFCore.SqlServer.Design.FunctionalTests/ReverseEngineering/SqlServerE2ETests.cs +++ b/test/EFCore.SqlServer.Design.FunctionalTests/ReverseEngineering/SqlServerE2ETests.cs @@ -117,15 +117,15 @@ namespace Microsoft.EntityFrameworkCore.ReverseEngineering Warn = { indexWarn, - RelationalDesignStrings.LogCannotFindTypeMappingForColumn.GenerateMessage("dbo.AllDataTypes.geographyColumn", "geography"), - RelationalDesignStrings.LogCannotFindTypeMappingForColumn.GenerateMessage("dbo.AllDataTypes.geometryColumn", "geometry"), - RelationalDesignStrings.LogCannotFindTypeMappingForColumn.GenerateMessage("dbo.AllDataTypes.hierarchyidColumn", "hierarchyid"), - RelationalDesignStrings.LogCannotFindTypeMappingForColumn.GenerateMessage("dbo.AllDataTypes.sql_variantColumn", "sql_variant"), - RelationalDesignStrings.LogUnableToScaffoldIndexMissingProperty.GenerateMessage("IX_UnscaffoldableIndex", "sql_variantColumn,hierarchyidColumn"), + DesignStrings.LogCannotFindTypeMappingForColumn.GenerateMessage("dbo.AllDataTypes.geographyColumn", "geography"), + DesignStrings.LogCannotFindTypeMappingForColumn.GenerateMessage("dbo.AllDataTypes.geometryColumn", "geometry"), + DesignStrings.LogCannotFindTypeMappingForColumn.GenerateMessage("dbo.AllDataTypes.hierarchyidColumn", "hierarchyid"), + DesignStrings.LogCannotFindTypeMappingForColumn.GenerateMessage("dbo.AllDataTypes.sql_variantColumn", "sql_variant"), + RelationalStrings.LogUnableToScaffoldIndexMissingProperty.GenerateMessage("IX_UnscaffoldableIndex", "sql_variantColumn,hierarchyidColumn"), //SqlServerDesignStrings.LogDataTypeDoesNotAllowSqlServerIdentityStrategy.GenerateMessage("dbo.PropertyConfiguration.PropertyConfigurationID", "tinyint"), - RelationalDesignStrings.LogCannotFindTypeMappingForColumn.GenerateMessage("dbo.TableWithUnmappablePrimaryKeyColumn.TableWithUnmappablePrimaryKeyColumnID", "hierarchyid"), - RelationalDesignStrings.LogPrimaryKeyErrorPropertyNotFound.GenerateMessage("dbo.TableWithUnmappablePrimaryKeyColumn", "TableWithUnmappablePrimaryKeyColumnID"), - RelationalDesignStrings.LogUnableToGenerateEntityType.GenerateMessage("dbo.TableWithUnmappablePrimaryKeyColumn") + DesignStrings.LogCannotFindTypeMappingForColumn.GenerateMessage("dbo.TableWithUnmappablePrimaryKeyColumn.TableWithUnmappablePrimaryKeyColumnID", "hierarchyid"), + DesignStrings.LogPrimaryKeyErrorPropertyNotFound.GenerateMessage("dbo.TableWithUnmappablePrimaryKeyColumn", "TableWithUnmappablePrimaryKeyColumnID"), + DesignStrings.LogUnableToGenerateEntityType.GenerateMessage("dbo.TableWithUnmappablePrimaryKeyColumn") } }); AssertEqualFileContents(expectedFileSet, actualFileSet); @@ -168,15 +168,15 @@ namespace Microsoft.EntityFrameworkCore.ReverseEngineering Warn = { indexWarn, - RelationalDesignStrings.LogCannotFindTypeMappingForColumn.GenerateMessage("dbo.AllDataTypes.geographyColumn", "geography"), - RelationalDesignStrings.LogCannotFindTypeMappingForColumn.GenerateMessage("dbo.AllDataTypes.geometryColumn", "geometry"), - RelationalDesignStrings.LogCannotFindTypeMappingForColumn.GenerateMessage("dbo.AllDataTypes.hierarchyidColumn", "hierarchyid"), - RelationalDesignStrings.LogCannotFindTypeMappingForColumn.GenerateMessage("dbo.AllDataTypes.sql_variantColumn", "sql_variant"), - RelationalDesignStrings.LogUnableToScaffoldIndexMissingProperty.GenerateMessage("IX_UnscaffoldableIndex", "sql_variantColumn,hierarchyidColumn"), + DesignStrings.LogCannotFindTypeMappingForColumn.GenerateMessage("dbo.AllDataTypes.geographyColumn", "geography"), + DesignStrings.LogCannotFindTypeMappingForColumn.GenerateMessage("dbo.AllDataTypes.geometryColumn", "geometry"), + DesignStrings.LogCannotFindTypeMappingForColumn.GenerateMessage("dbo.AllDataTypes.hierarchyidColumn", "hierarchyid"), + DesignStrings.LogCannotFindTypeMappingForColumn.GenerateMessage("dbo.AllDataTypes.sql_variantColumn", "sql_variant"), + RelationalStrings.LogUnableToScaffoldIndexMissingProperty.GenerateMessage("IX_UnscaffoldableIndex", "sql_variantColumn,hierarchyidColumn"), //SqlServerDesignStrings.LogDataTypeDoesNotAllowSqlServerIdentityStrategy.GenerateMessage("dbo.PropertyConfiguration.PropertyConfigurationID", "tinyint"), - RelationalDesignStrings.LogCannotFindTypeMappingForColumn.GenerateMessage("dbo.TableWithUnmappablePrimaryKeyColumn.TableWithUnmappablePrimaryKeyColumnID", "hierarchyid"), - RelationalDesignStrings.LogPrimaryKeyErrorPropertyNotFound.GenerateMessage("dbo.TableWithUnmappablePrimaryKeyColumn", "TableWithUnmappablePrimaryKeyColumnID"), - RelationalDesignStrings.LogUnableToGenerateEntityType.GenerateMessage("dbo.TableWithUnmappablePrimaryKeyColumn") + DesignStrings.LogCannotFindTypeMappingForColumn.GenerateMessage("dbo.TableWithUnmappablePrimaryKeyColumn.TableWithUnmappablePrimaryKeyColumnID", "hierarchyid"), + DesignStrings.LogPrimaryKeyErrorPropertyNotFound.GenerateMessage("dbo.TableWithUnmappablePrimaryKeyColumn", "TableWithUnmappablePrimaryKeyColumnID"), + DesignStrings.LogUnableToGenerateEntityType.GenerateMessage("dbo.TableWithUnmappablePrimaryKeyColumn") } }); AssertEqualFileContents(expectedFileSet, actualFileSet); @@ -249,8 +249,8 @@ CREATE SEQUENCE NumericSequence { Warn = { - RelationalDesignStrings.LogBadSequenceType.GenerateMessage("DecimalSequence", "decimal"), - RelationalDesignStrings.LogBadSequenceType.GenerateMessage("NumericSequence", "numeric") + DesignStrings.LogBadSequenceType.GenerateMessage("DecimalSequence", "decimal"), + DesignStrings.LogBadSequenceType.GenerateMessage("NumericSequence", "numeric") } }); diff --git a/test/EFCore.Sqlite.Design.FunctionalTests/ReverseEngineering/SqliteE2ETestBase.cs b/test/EFCore.Sqlite.Design.FunctionalTests/ReverseEngineering/SqliteE2ETestBase.cs index bbefb72fe8..9079fe7398 100644 --- a/test/EFCore.Sqlite.Design.FunctionalTests/ReverseEngineering/SqliteE2ETestBase.cs +++ b/test/EFCore.Sqlite.Design.FunctionalTests/ReverseEngineering/SqliteE2ETestBase.cs @@ -233,12 +233,12 @@ CREATE TABLE IF NOT EXISTS Users_Groups ( useDataAnnotations: UseDataAnnotations, overwriteFiles: false); - var errorMessage = RelationalDesignStrings.LogUnableToGenerateEntityType.GenerateMessage("Alicia"); + var errorMessage = DesignStrings.LogUnableToGenerateEntityType.GenerateMessage("Alicia"); var expectedLog = new LoggerMessages { Warn = { - RelationalDesignStrings.LogMissingPrimaryKey.GenerateMessage("Alicia"), + DesignStrings.LogMissingPrimaryKey.GenerateMessage("Alicia"), errorMessage } }; @@ -273,9 +273,9 @@ CREATE TABLE IF NOT EXISTS Principal ( Id INT);"); { Warn = { - RelationalDesignStrings.LogMissingPrimaryKey.GenerateMessage("Principal"), - RelationalDesignStrings.LogUnableToGenerateEntityType.GenerateMessage("Principal"), - RelationalDesignStrings.LogForeignKeyScaffoldErrorPrincipalTableScaffoldingError.GenerateMessage("Dependent(PrincipalId)", "Principal") + DesignStrings.LogMissingPrimaryKey.GenerateMessage("Principal"), + DesignStrings.LogUnableToGenerateEntityType.GenerateMessage("Principal"), + DesignStrings.LogForeignKeyScaffoldErrorPrincipalTableScaffoldingError.GenerateMessage("Dependent(PrincipalId)", "Principal") } }; AssertLog(expectedLog); diff --git a/test/EFCore.Sqlite.Design.FunctionalTests/SqliteScaffoldingModelFactoryTest.cs b/test/EFCore.Sqlite.Design.FunctionalTests/SqliteScaffoldingModelFactoryTest.cs index fc7b6bccb5..6699cb397b 100644 --- a/test/EFCore.Sqlite.Design.FunctionalTests/SqliteScaffoldingModelFactoryTest.cs +++ b/test/EFCore.Sqlite.Design.FunctionalTests/SqliteScaffoldingModelFactoryTest.cs @@ -208,7 +208,7 @@ namespace Microsoft.EntityFrameworkCore _loggerFactory.Logger.Statements, t => t.Contains( "Warning: " + - RelationalDesignStrings.LogForeignKeyScaffoldErrorPrincipalTableNotFound.GenerateMessage("0"))); + RelationalStrings.LogForeignKeyScaffoldErrorPrincipalTableNotFound.GenerateMessage("0"))); } [Fact] @@ -228,7 +228,7 @@ namespace Microsoft.EntityFrameworkCore _loggerFactory.Logger.Statements, t => t.Contains( "Warning: " + - RelationalDesignStrings.LogPrincipalColumnNotFound.GenerateMessage("0", "Children", "Id", "Parent"))); + RelationalStrings.LogPrincipalColumnNotFound.GenerateMessage("0", "Children", "Id", "Parent"))); } [Fact] diff --git a/test/ef.Tests/AppDomainOperationExecutorTest.cs b/test/ef.Tests/AppDomainOperationExecutorTest.cs index 7a97c4784d..0268e72066 100644 --- a/test/ef.Tests/AppDomainOperationExecutorTest.cs +++ b/test/ef.Tests/AppDomainOperationExecutorTest.cs @@ -54,7 +54,6 @@ namespace Microsoft.EntityFrameworkCore.Tools BuildReference.ByName("Microsoft.EntityFrameworkCore", true), BuildReference.ByName("Microsoft.EntityFrameworkCore.Design", true), BuildReference.ByName("Microsoft.EntityFrameworkCore.Relational", true), - BuildReference.ByName("Microsoft.EntityFrameworkCore.Relational.Design", true), BuildReference.ByName("Microsoft.EntityFrameworkCore.SqlServer", true), BuildReference.ByName("Microsoft.Extensions.Caching.Abstractions", true), BuildReference.ByName("Microsoft.Extensions.Caching.Memory", true), @@ -160,7 +159,6 @@ namespace Microsoft.EntityFrameworkCore.Tools BuildReference.ByName("Microsoft.EntityFrameworkCore"), BuildReference.ByName("Microsoft.EntityFrameworkCore.Design", true), BuildReference.ByName("Microsoft.EntityFrameworkCore.Relational", true), - BuildReference.ByName("Microsoft.EntityFrameworkCore.Relational.Design", true), BuildReference.ByName("Microsoft.Extensions.DependencyInjection", true), BuildReference.ByName("Microsoft.Extensions.DependencyInjection.Abstractions", true), BuildReference.ByName("Microsoft.Extensions.Logging", true), @@ -232,7 +230,6 @@ namespace Microsoft.EntityFrameworkCore.Tools BuildReference.ByName("Microsoft.EntityFrameworkCore", true), BuildReference.ByName("Microsoft.EntityFrameworkCore.Design", true), BuildReference.ByName("Microsoft.EntityFrameworkCore.Relational", true), - BuildReference.ByName("Microsoft.EntityFrameworkCore.Relational.Design", true), BuildReference.ByName("Microsoft.EntityFrameworkCore.SqlServer", true), BuildReference.ByName("Microsoft.Extensions.Caching.Abstractions", true), BuildReference.ByName("Microsoft.Extensions.Caching.Memory", true), @@ -304,7 +301,6 @@ namespace Microsoft.EntityFrameworkCore.Tools BuildReference.ByName("Microsoft.EntityFrameworkCore", true), BuildReference.ByName("Microsoft.EntityFrameworkCore.Design", true), BuildReference.ByName("Microsoft.EntityFrameworkCore.Relational", true), - BuildReference.ByName("Microsoft.EntityFrameworkCore.Relational.Design", true), BuildReference.ByName("Microsoft.Extensions.DependencyInjection", true), BuildReference.ByName("Microsoft.Extensions.DependencyInjection.Abstractions", true), BuildReference.ByName("Microsoft.Extensions.Logging", true), diff --git a/test/ef.Tests/SimpleProjectTest.cs b/test/ef.Tests/SimpleProjectTest.cs index fd97bc3d18..59e025bbae 100644 --- a/test/ef.Tests/SimpleProjectTest.cs +++ b/test/ef.Tests/SimpleProjectTest.cs @@ -141,7 +141,6 @@ namespace Microsoft.EntityFrameworkCore.Tools BuildReference.ByName("Microsoft.EntityFrameworkCore", true), BuildReference.ByName("Microsoft.EntityFrameworkCore.Design", true), BuildReference.ByName("Microsoft.EntityFrameworkCore.Relational", true), - BuildReference.ByName("Microsoft.EntityFrameworkCore.Relational.Design", true), BuildReference.ByName("Microsoft.EntityFrameworkCore.SqlServer", true), BuildReference.ByName("Microsoft.Extensions.Caching.Abstractions", true), BuildReference.ByName("Microsoft.Extensions.Caching.Memory", true),