Remove Relational.Design package

This commit is contained in:
Smit Patel 2017-06-01 15:51:15 -07:00
Родитель 32434d2d86
Коммит 778a843444
54 изменённых файлов: 1619 добавлений и 5258 удалений

Просмотреть файл

@ -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}

Просмотреть файл

@ -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
{
/// <summary>
/// <para>
/// Event IDs for design events that correspond to messages logged to an <see cref="ILogger" />
/// and events sent to a <see cref="DiagnosticSource" />.
/// </para>
/// <para>
/// These IDs are also used with <see cref="WarningsConfigurationBuilder" /> to configure the
/// behavior of warnings.
/// </para>
/// </summary>
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 <Noun><Verb> 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);
/// <summary>
/// The database is missing a schema.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId MissingSchemaWarning = MakeScaffoldingId(Id.MissingSchemaWarning);
/// <summary>
/// The database has a sequence of a type that is not supported.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId SequenceTypeNotSupportedWarning = MakeScaffoldingId(Id.SequenceTypeNotSupportedWarning);
/// <summary>
/// An entity type could not be generated.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId UnableToGenerateEntityTypeWarning = MakeScaffoldingId(Id.UnableToGenerateEntityTypeWarning);
/// <summary>
/// A column type could not be mapped.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId ColumnTypeNotMappedWarning = MakeScaffoldingId(Id.ColumnTypeNotMappedWarning);
/// <summary>
/// A table is missing a primary key.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId MissingPrimaryKeyWarning = MakeScaffoldingId(Id.MissingPrimaryKeyWarning);
/// <summary>
/// Columns in a primary key were not mapped.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId PrimaryKeyColumnsNotMappedWarning = MakeScaffoldingId(Id.PrimaryKeyColumnsNotMappedWarning);
/// <summary>
/// A foreign key references a table that was not mapped.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId ForeignKeyReferencesNotMappedTableWarning = MakeScaffoldingId(Id.ForeignKeyReferencesNotMappedTableWarning);
/// <summary>
/// A foreign key references missing prinicpal key columns.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId ForeignKeyReferencesMissingPrincipalKeyWarning = MakeScaffoldingId(Id.ForeignKeyReferencesMissingPrincipalKeyWarning);
/// <summary>
/// A principal key contains nullable columns.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId ForeignKeyPrincipalEndContainsNullableColumnsWarning = MakeScaffoldingId(Id.ForeignKeyPrincipalEndContainsNullableColumnsWarning);
}
}

Просмотреть файл

@ -17,7 +17,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EFCore.Relational.Design\EFCore.Relational.Design.csproj" />
<ProjectReference Include="..\EFCore.Relational\EFCore.Relational.csproj" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -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
{
/// <summary>
/// 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.
/// </summary>
public static class DesignLoggerExtensions
{
/// <summary>
/// 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.
/// </summary>
public static void MissingSchemaWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void SequenceTypeNotSupportedWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void UnableToGenerateEntityTypeWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void ColumnTypeNotMappedWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void MissingPrimaryKeyWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void PrimaryKeyColumnsNotMappedWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> diagnostics,
[CanBeNull] string tableName,
[NotNull] IList<string> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void ForeignKeyReferencesNotMappedTableWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void ForeignKeyReferencesMissingPrincipalKeyWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> diagnostics,
[CanBeNull] string foreignKeyName,
[CanBeNull] string principalEntityTypeName,
[NotNull] IList<string> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void ForeignKeyPrincipalEndContainsNullableColumnsWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> diagnostics,
[CanBeNull] string foreignKeyName,
[CanBeNull] string indexName,
[CanBeNull] IList<string> 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
});
}
}
}
}

132
src/EFCore.Design/Properties/DesignStrings.Designer.cs сгенерированный
Просмотреть файл

@ -460,6 +460,138 @@ namespace Microsoft.EntityFrameworkCore.Internal
GetString("FoundContextFactory", nameof(factory)),
factory);
/// <summary>
/// Metadata model returned should not be null. Provider: {providerTypeName}.
/// </summary>
public static string ProviderReturnedNullModel([CanBeNull] object providerTypeName)
=> string.Format(
GetString("ProviderReturnedNullModel", nameof(providerTypeName)),
providerTypeName);
/// <summary>
/// No files generated in directory {outputDirectoryName}. The following file(s) already exist and must be made writeable to continue: {readOnlyFiles}.
/// </summary>
public static string ReadOnlyFiles([CanBeNull] object outputDirectoryName, [CanBeNull] object readOnlyFiles)
=> string.Format(
GetString("ReadOnlyFiles", nameof(outputDirectoryName), nameof(readOnlyFiles)),
outputDirectoryName, readOnlyFiles);
/// <summary>
/// The following file(s) already exist in directory {outputDirectoryName}: {existingFiles}. Use the Force flag to overwrite these files.
/// </summary>
public static string ExistingFiles([CanBeNull] object outputDirectoryName, [CanBeNull] object existingFiles)
=> string.Format(
GetString("ExistingFiles", nameof(outputDirectoryName), nameof(existingFiles)),
outputDirectoryName, existingFiles);
/// <summary>
/// Could not find type mapping for column '{columnName}' with data type '{dateType}'. Skipping column.
/// </summary>
public static readonly EventDefinition<string, string> LogCannotFindTypeMappingForColumn
= new EventDefinition<string, string>(
DesignEventId.ColumnTypeNotMappedWarning,
LogLevel.Warning,
LoggerMessage.Define<string, string>(
LogLevel.Warning,
DesignEventId.ColumnTypeNotMappedWarning,
_resourceManager.GetString("LogCannotFindTypeMappingForColumn")));
/// <summary>
/// Could not scaffold the foreign key '{foreignKeyName}'. A key for '{columnsList}' was not found in the principal entity type '{principalEntityType}'.
/// </summary>
public static readonly EventDefinition<string, string, string> LogForeignKeyScaffoldErrorPrincipalKeyNotFound
= new EventDefinition<string, string, string>(
DesignEventId.ForeignKeyReferencesMissingPrincipalKeyWarning,
LogLevel.Warning,
LoggerMessage.Define<string, string, string>(
LogLevel.Warning,
DesignEventId.ForeignKeyReferencesMissingPrincipalKeyWarning,
_resourceManager.GetString("LogForeignKeyScaffoldErrorPrincipalKeyNotFound")));
/// <summary>
/// Could not scaffold the foreign key '{foreignKeyName}'. The referenced table '{principaltableName}' could not be scaffolded.
/// </summary>
public static readonly EventDefinition<string, string> LogForeignKeyScaffoldErrorPrincipalTableScaffoldingError
= new EventDefinition<string, string>(
DesignEventId.ForeignKeyReferencesNotMappedTableWarning,
LogLevel.Warning,
LoggerMessage.Define<string, string>(
LogLevel.Warning,
DesignEventId.ForeignKeyReferencesNotMappedTableWarning,
_resourceManager.GetString("LogForeignKeyScaffoldErrorPrincipalTableScaffoldingError")));
/// <summary>
/// Could not scaffold the primary key for '{tableName}'. The following columns in the primary key could not be scaffolded: {columnNames}.
/// </summary>
public static readonly EventDefinition<string, string> LogPrimaryKeyErrorPropertyNotFound
= new EventDefinition<string, string>(
DesignEventId.PrimaryKeyColumnsNotMappedWarning,
LogLevel.Warning,
LoggerMessage.Define<string, string>(
LogLevel.Warning,
DesignEventId.PrimaryKeyColumnsNotMappedWarning,
_resourceManager.GetString("LogPrimaryKeyErrorPropertyNotFound")));
/// <summary>
/// Unable to identify the primary key for table '{tableName}'.
/// </summary>
public static readonly EventDefinition<string> LogMissingPrimaryKey
= new EventDefinition<string>(
DesignEventId.MissingPrimaryKeyWarning,
LogLevel.Warning,
LoggerMessage.Define<string>(
LogLevel.Warning,
DesignEventId.MissingPrimaryKeyWarning,
_resourceManager.GetString("LogMissingPrimaryKey")));
/// <summary>
/// Unable to generate entity type for table '{tableName}'.
/// </summary>
public static readonly EventDefinition<string> LogUnableToGenerateEntityType
= new EventDefinition<string>(
DesignEventId.UnableToGenerateEntityTypeWarning,
LogLevel.Warning,
LoggerMessage.Define<string>(
LogLevel.Warning,
DesignEventId.UnableToGenerateEntityTypeWarning,
_resourceManager.GetString("LogUnableToGenerateEntityType")));
/// <summary>
/// For sequence '{sequenceName}'. Unable to scaffold because it uses an unsupported type: '{typeName}'.
/// </summary>
public static readonly EventDefinition<string, string> LogBadSequenceType
= new EventDefinition<string, string>(
DesignEventId.SequenceTypeNotSupportedWarning,
LogLevel.Warning,
LoggerMessage.Define<string, string>(
LogLevel.Warning,
DesignEventId.SequenceTypeNotSupportedWarning,
_resourceManager.GetString("LogBadSequenceType")));
/// <summary>
/// Unable to find a schema in the database matching the selected schema {schema}.
/// </summary>
public static readonly EventDefinition<string> LogMissingSchema
= new EventDefinition<string>(
DesignEventId.MissingSchemaWarning,
LogLevel.Warning,
LoggerMessage.Define<string>(
LogLevel.Warning,
DesignEventId.MissingSchemaWarning,
_resourceManager.GetString("LogMissingSchema")));
/// <summary>
/// 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.
/// </summary>
public static readonly EventDefinition<string, string, string> LogForeignKeyPrincipalEndContainsNullableColumns
= new EventDefinition<string, string, string>(
DesignEventId.ForeignKeyPrincipalEndContainsNullableColumnsWarning,
LogLevel.Warning,
LoggerMessage.Define<string, string, string>(
LogLevel.Warning,
DesignEventId.ForeignKeyPrincipalEndContainsNullableColumnsWarning,
_resourceManager.GetString("LogForeignKeyPrincipalEndContainsNullableColumns")));
private static string GetString(string name, params string[] formatterNames)
{
var value = _resourceManager.GetString(name);

Просмотреть файл

@ -297,4 +297,49 @@ Change your target project to the migrations project by using the Package Manage
<data name="FoundContextFactory" xml:space="preserve">
<value>Found IDesignTimeDbContextFactory implementation '{factory}'.</value>
</data>
<data name="ProviderReturnedNullModel" xml:space="preserve">
<value>Metadata model returned should not be null. Provider: {providerTypeName}.</value>
</data>
<data name="ReadOnlyFiles" xml:space="preserve">
<value>No files generated in directory {outputDirectoryName}. The following file(s) already exist and must be made writeable to continue: {readOnlyFiles}.</value>
</data>
<data name="ExistingFiles" xml:space="preserve">
<value>The following file(s) already exist in directory {outputDirectoryName}: {existingFiles}. Use the Force flag to overwrite these files.</value>
</data>
<data name="LogCannotFindTypeMappingForColumn" xml:space="preserve">
<value>Could not find type mapping for column '{columnName}' with data type '{dateType}'. Skipping column.</value>
<comment>Warning DesignEventId.ColumnTypeNotMappedWarning string string</comment>
</data>
<data name="LogForeignKeyScaffoldErrorPrincipalKeyNotFound" xml:space="preserve">
<value>Could not scaffold the foreign key '{foreignKeyName}'. A key for '{columnsList}' was not found in the principal entity type '{principalEntityType}'.</value>
<comment>Warning DesignEventId.ForeignKeyReferencesMissingPrincipalKeyWarning string string string</comment>
</data>
<data name="LogForeignKeyScaffoldErrorPrincipalTableScaffoldingError" xml:space="preserve">
<value>Could not scaffold the foreign key '{foreignKeyName}'. The referenced table '{principaltableName}' could not be scaffolded.</value>
<comment>Warning DesignEventId.ForeignKeyReferencesNotMappedTableWarning string string</comment>
</data>
<data name="LogPrimaryKeyErrorPropertyNotFound" xml:space="preserve">
<value>Could not scaffold the primary key for '{tableName}'. The following columns in the primary key could not be scaffolded: {columnNames}.</value>
<comment>Warning DesignEventId.PrimaryKeyColumnsNotMappedWarning string string</comment>
</data>
<data name="LogMissingPrimaryKey" xml:space="preserve">
<value>Unable to identify the primary key for table '{tableName}'.</value>
<comment>Warning DesignEventId.MissingPrimaryKeyWarning string</comment>
</data>
<data name="LogUnableToGenerateEntityType" xml:space="preserve">
<value>Unable to generate entity type for table '{tableName}'.</value>
<comment>Warning DesignEventId.UnableToGenerateEntityTypeWarning string</comment>
</data>
<data name="LogBadSequenceType" xml:space="preserve">
<value>For sequence '{sequenceName}'. Unable to scaffold because it uses an unsupported type: '{typeName}'.</value>
<comment>Warning DesignEventId.SequenceTypeNotSupportedWarning string string</comment>
</data>
<data name="LogMissingSchema" xml:space="preserve">
<value>Unable to find a schema in the database matching the selected schema {schema}.</value>
<comment>Warning DesignEventId.MissingSchemaWarning string</comment>
</data>
<data name="LogForeignKeyPrincipalEndContainsNullableColumns" xml:space="preserve">
<value>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.</value>
<comment>Warning DesignEventId.ForeignKeyPrincipalEndContainsNullableColumnsWarning string string string</comment>
</data>
</root>

Просмотреть файл

@ -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)));

Просмотреть файл

@ -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;

Просмотреть файл

@ -15,7 +15,7 @@
<ItemGroup>
<ProjectReference Include="..\EFCore.Design\EFCore.Design.csproj" />
<ProjectReference Include="..\EFCore.Relational.Design\EFCore.Relational.Design.csproj" />
<ProjectReference Include="..\EFCore.Relational\EFCore.Relational.csproj" />
<ProjectReference Include="..\EFCore.Relational.Specification.Tests\EFCore.Relational.Specification.Tests.csproj" />
</ItemGroup>

Просмотреть файл

@ -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
{
/// <summary>
/// <para>
/// Event IDs for relational design events that correspond to messages logged to an <see cref="ILogger" />
/// and events sent to a <see cref="DiagnosticSource" />.
/// </para>
/// <para>
/// These IDs are also used with <see cref="WarningsConfigurationBuilder" /> to configure the
/// behavior of warnings.
/// </para>
/// </summary>
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 <Noun><Verb> 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);
/// <summary>
/// The database is missing a schema.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId MissingSchemaWarning = MakeScaffoldingId(Id.MissingSchemaWarning);
/// <summary>
/// The database is missing a table.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId MissingTableWarning = MakeScaffoldingId(Id.MissingTableWarning);
/// <summary>
/// The database has an unnamed sequence.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId SequenceNotNamedWarning = MakeScaffoldingId(Id.SequenceNotNamedWarning);
/// <summary>
/// The database has a sequence of a type that is not supported.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId SequenceTypeNotSupportedWarning = MakeScaffoldingId(Id.SequenceTypeNotSupportedWarning);
/// <summary>
/// An entity type could not be generated.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId UnableToGenerateEntityTypeWarning = MakeScaffoldingId(Id.UnableToGenerateEntityTypeWarning);
/// <summary>
/// A column type could not be mapped.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId ColumnTypeNotMappedWarning = MakeScaffoldingId(Id.ColumnTypeNotMappedWarning);
/// <summary>
/// A table is missing a primary key.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId MissingPrimaryKeyWarning = MakeScaffoldingId(Id.MissingPrimaryKeyWarning);
/// <summary>
/// Columns in a primary key were not mapped.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId PrimaryKeyColumnsNotMappedWarning = MakeScaffoldingId(Id.PrimaryKeyColumnsNotMappedWarning);
/// <summary>
/// Columns in an index were not mapped.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId IndexColumnsNotMappedWarning = MakeScaffoldingId(Id.IndexColumnsNotMappedWarning);
/// <summary>
/// A foreign key references a missing table.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId ForeignKeyReferencesMissingTableWarning = MakeScaffoldingId(Id.ForeignKeyReferencesMissingTableWarning);
/// <summary>
/// A foreign key references a missing table at the principal end.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId ForeignKeyReferencesMissingPrincipalTableWarning = MakeScaffoldingId(Id.ForeignKeyReferencesMissingPrincipalTableWarning);
/// <summary>
/// A foreign key references a table that was not mapped.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId ForeignKeyReferencesNotMappedTableWarning = MakeScaffoldingId(Id.ForeignKeyReferencesNotMappedTableWarning);
/// <summary>
/// Columns in a foreign key were not mapped.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId ForeignKeyColumnsNotMappedWarning = MakeScaffoldingId(Id.ForeignKeyColumnsNotMappedWarning);
/// <summary>
/// A foreign key references missing prinicpal key columns.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId ForeignKeyReferencesMissingPrincipalKeyWarning = MakeScaffoldingId(Id.ForeignKeyReferencesMissingPrincipalKeyWarning);
/// <summary>
/// A principal key contains nullable columns.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId ForeignKeyPrincipalEndContainsNullableColumnsWarning = MakeScaffoldingId(Id.ForeignKeyPrincipalEndContainsNullableColumnsWarning);
/// <summary>
/// A foreign key is not named.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId ForeignKeyNotNamedWarning = MakeScaffoldingId(Id.ForeignKeyNotNamedWarning);
/// <summary>
/// A foreign key column was not found.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId ForeignKeyColumnMissingWarning = MakeScaffoldingId(Id.ForeignKeyColumnMissingWarning);
/// <summary>
/// A column referenced by a foreign key constraint was not found.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId ForeignKeyPrincipalColumnMissingWarning = MakeScaffoldingId(Id.ForeignKeyPrincipalColumnMissingWarning);
/// <summary>
/// A foreign key column was not named.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId ForeignKeyColumnNotNamedWarning = MakeScaffoldingId(Id.ForeignKeyColumnNotNamedWarning);
/// <summary>
/// A column is not named.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId ColumnNotNamedWarning = MakeScaffoldingId(Id.ColumnNotNamedWarning);
/// <summary>
/// An index is not named.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId IndexNotNamedWarning = MakeScaffoldingId(Id.IndexNotNamedWarning);
/// <summary>
/// The table referened by an index was not found.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId IndexTableMissingWarning = MakeScaffoldingId(Id.IndexTableMissingWarning);
/// <summary>
/// An index column was not named.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId IndexColumnNotNamedWarning = MakeScaffoldingId(Id.IndexColumnNotNamedWarning);
/// <summary>
/// A table was found.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId TableFound = MakeScaffoldingId(Id.TableFound);
/// <summary>
/// A table was skipped.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId TableSkipped = MakeScaffoldingId(Id.TableSkipped);
/// <summary>
/// A column was skipped.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId ColumnSkipped = MakeScaffoldingId(Id.ColumnSkipped);
/// <summary>
/// An index was found.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId IndexFound = MakeScaffoldingId(Id.IndexFound);
/// <summary>
/// An index was skipped.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId IndexColumnFound = MakeScaffoldingId(Id.IndexColumnFound);
/// <summary>
/// A column of an index was skipped.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId IndexColumnSkipped = MakeScaffoldingId(Id.IndexColumnSkipped);
/// <summary>
/// A sequence was found.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId SequenceFound = MakeScaffoldingId(Id.SequenceFound);
}
}

Просмотреть файл

@ -1,52 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<Description>Shared design-time Entity Framework Core components for relational database providers.</Description>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Microsoft.EntityFrameworkCore.Relational.Design</AssemblyName>
<RootNamespace>Microsoft.EntityFrameworkCore</RootNamespace>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<CodeAnalysisRuleSet>..\EFCore.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Shared\*.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EFCore.Relational\EFCore.Relational.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="Properties\RelationalDesignStrings.Designer.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>RelationalDesignStrings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\RelationalDesignStrings.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>RelationalDesignStrings.Designer.tt</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\RelationalDesignStrings.resx">
<CustomToolNamespace>Microsoft.EntityFrameworkCore.Internal</CustomToolNamespace>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="$(StyleCopAnalyzersVersion)" PrivateAssets="All" />
</ItemGroup>
</Project>

Просмотреть файл

@ -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
{
/// <summary>
/// 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.
/// </summary>
public static class RelationalDesignLoggerExtensions
{
/// <summary>
/// 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.
/// </summary>
public static void MissingSchemaWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void MissingTableWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void SequenceNotNamedWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> diagnostics)
{
var definition = RelationalDesignStrings.LogSequencesRequireName;
definition.Log(diagnostics);
if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name))
{
diagnostics.DiagnosticSource.Write(definition.EventId.Name, null);
}
}
/// <summary>
/// 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.
/// </summary>
public static void SequenceTypeNotSupportedWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void UnableToGenerateEntityTypeWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void ColumnTypeNotMappedWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void MissingPrimaryKeyWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void PrimaryKeyColumnsNotMappedWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> diagnostics,
[CanBeNull] string tableName,
[NotNull] IList<string> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void IndexColumnsNotMappedWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> diagnostics,
[CanBeNull] string indexName,
[NotNull] IList<string> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void ForeignKeyReferencesMissingTableWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void ForeignKeyReferencesNotMappedTableWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void ForeignKeyColumnsNotMappedWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> diagnostics,
[CanBeNull] string foreignKeyName,
[NotNull] IList<string> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void ForeignKeyReferencesMissingPrincipalKeyWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> diagnostics,
[CanBeNull] string foreignKeyName,
[CanBeNull] string principalEntityTypeName,
[NotNull] IList<string> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void ForeignKeyPrincipalEndContainsNullableColumnsWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> diagnostics,
[CanBeNull] string foreignKeyName,
[CanBeNull] string indexName,
[CanBeNull] IList<string> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void SequenceFound(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void TableFound(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void TableSkipped(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void ColumnSkipped(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void IndexColumnFound(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void ColumnNotNamedWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void IndexColumnSkipped(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void IndexNotNamedWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void IndexTableMissingWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void IndexColumnNotNamedWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void ForeignKeyNotNamedWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void ForeignKeyColumnMissingWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void ForeignKeyReferencesMissingPrincipalTableWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void ForeignKeyColumnNotNamedWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void IndexFound(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void ForeignKeyPrincipalColumnMissingWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
}
}

Просмотреть файл

@ -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")]

Просмотреть файл

@ -1,413 +0,0 @@
// <auto-generated />
using System;
using System.Reflection;
using System.Resources;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore.Diagnostics;
using Microsoft.Extensions.Logging;
namespace Microsoft.EntityFrameworkCore.Internal
{
/// <summary>
/// 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.
/// </summary>
public static class RelationalDesignStrings
{
private static readonly ResourceManager _resourceManager
= new ResourceManager("Microsoft.EntityFrameworkCore.Properties.RelationalDesignStrings", typeof(RelationalDesignStrings).GetTypeInfo().Assembly);
/// <summary>
/// Metadata model returned should not be null. Provider: {providerTypeName}.
/// </summary>
public static string ProviderReturnedNullModel([CanBeNull] object providerTypeName)
=> string.Format(
GetString("ProviderReturnedNullModel", nameof(providerTypeName)),
providerTypeName);
/// <summary>
/// No files generated in directory {outputDirectoryName}. The following file(s) already exist and must be made writeable to continue: {readOnlyFiles}.
/// </summary>
public static string ReadOnlyFiles([CanBeNull] object outputDirectoryName, [CanBeNull] object readOnlyFiles)
=> string.Format(
GetString("ReadOnlyFiles", nameof(outputDirectoryName), nameof(readOnlyFiles)),
outputDirectoryName, readOnlyFiles);
/// <summary>
/// The following file(s) already exist in directory {outputDirectoryName}: {existingFiles}. Use the Force flag to overwrite these files.
/// </summary>
public static string ExistingFiles([CanBeNull] object outputDirectoryName, [CanBeNull] object existingFiles)
=> string.Format(
GetString("ExistingFiles", nameof(outputDirectoryName), nameof(existingFiles)),
outputDirectoryName, existingFiles);
/// <summary>
/// Found a column on index {indexName} on table {tableName} with an empty or null name. Not including column in index.
/// </summary>
public static readonly EventDefinition<string, string> LogColumnNameEmptyOnIndex
= new EventDefinition<string, string>(
RelationalDesignEventId.IndexColumnNotNamedWarning,
LogLevel.Warning,
LoggerMessage.Define<string, string>(
LogLevel.Warning,
RelationalDesignEventId.IndexColumnNotNamedWarning,
_resourceManager.GetString("LogColumnNameEmptyOnIndex")));
/// <summary>
/// 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.
/// </summary>
public static readonly EventDefinition<string, string, string, string> LogPrincipalColumnNotFound
= new EventDefinition<string, string, string, string>(
RelationalDesignEventId.ForeignKeyPrincipalColumnMissingWarning,
LogLevel.Warning,
LoggerMessage.Define<string, string, string, string>(
LogLevel.Warning,
RelationalDesignEventId.ForeignKeyPrincipalColumnMissingWarning,
_resourceManager.GetString("LogPrincipalColumnNotFound")));
/// <summary>
/// Could not find type mapping for column '{columnName}' with data type '{dateType}'. Skipping column.
/// </summary>
public static readonly EventDefinition<string, string> LogCannotFindTypeMappingForColumn
= new EventDefinition<string, string>(
RelationalDesignEventId.ColumnTypeNotMappedWarning,
LogLevel.Warning,
LoggerMessage.Define<string, string>(
LogLevel.Warning,
RelationalDesignEventId.ColumnTypeNotMappedWarning,
_resourceManager.GetString("LogCannotFindTypeMappingForColumn")));
/// <summary>
/// Could not scaffold the foreign key '{foreignKeyName}'. A key for '{columnsList}' was not found in the principal entity type '{principalEntityType}'.
/// </summary>
public static readonly EventDefinition<string, string, string> LogForeignKeyScaffoldErrorPrincipalKeyNotFound
= new EventDefinition<string, string, string>(
RelationalDesignEventId.ForeignKeyReferencesMissingPrincipalKeyWarning,
LogLevel.Warning,
LoggerMessage.Define<string, string, string>(
LogLevel.Warning,
RelationalDesignEventId.ForeignKeyReferencesMissingPrincipalKeyWarning,
_resourceManager.GetString("LogForeignKeyScaffoldErrorPrincipalKeyNotFound")));
/// <summary>
/// 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.
/// </summary>
public static readonly EventDefinition<string> LogForeignKeyScaffoldErrorPrincipalTableNotFound
= new EventDefinition<string>(
RelationalDesignEventId.ForeignKeyReferencesMissingTableWarning,
LogLevel.Warning,
LoggerMessage.Define<string>(
LogLevel.Warning,
RelationalDesignEventId.ForeignKeyReferencesMissingTableWarning,
_resourceManager.GetString("LogForeignKeyScaffoldErrorPrincipalTableNotFound")));
/// <summary>
/// Could not scaffold the foreign key '{foreignKeyName}'. The referenced table '{principaltableName}' could not be scaffolded.
/// </summary>
public static readonly EventDefinition<string, string> LogForeignKeyScaffoldErrorPrincipalTableScaffoldingError
= new EventDefinition<string, string>(
RelationalDesignEventId.ForeignKeyReferencesNotMappedTableWarning,
LogLevel.Warning,
LoggerMessage.Define<string, string>(
LogLevel.Warning,
RelationalDesignEventId.ForeignKeyReferencesNotMappedTableWarning,
_resourceManager.GetString("LogForeignKeyScaffoldErrorPrincipalTableScaffoldingError")));
/// <summary>
/// Could not scaffold the foreign key '{foreignKeyName}'. The following columns in the foreign key could not be scaffolded: {columnNames}.
/// </summary>
public static readonly EventDefinition<string, string> LogForeignKeyScaffoldErrorPropertyNotFound
= new EventDefinition<string, string>(
RelationalDesignEventId.ForeignKeyColumnsNotMappedWarning,
LogLevel.Warning,
LoggerMessage.Define<string, string>(
LogLevel.Warning,
RelationalDesignEventId.ForeignKeyColumnsNotMappedWarning,
_resourceManager.GetString("LogForeignKeyScaffoldErrorPropertyNotFound")));
/// <summary>
/// Could not scaffold the primary key for '{tableName}'. The following columns in the primary key could not be scaffolded: {columnNames}.
/// </summary>
public static readonly EventDefinition<string, string> LogPrimaryKeyErrorPropertyNotFound
= new EventDefinition<string, string>(
RelationalDesignEventId.PrimaryKeyColumnsNotMappedWarning,
LogLevel.Warning,
LoggerMessage.Define<string, string>(
LogLevel.Warning,
RelationalDesignEventId.PrimaryKeyColumnsNotMappedWarning,
_resourceManager.GetString("LogPrimaryKeyErrorPropertyNotFound")));
/// <summary>
/// Unable to identify the primary key for table '{tableName}'.
/// </summary>
public static readonly EventDefinition<string> LogMissingPrimaryKey
= new EventDefinition<string>(
RelationalDesignEventId.MissingPrimaryKeyWarning,
LogLevel.Warning,
LoggerMessage.Define<string>(
LogLevel.Warning,
RelationalDesignEventId.MissingPrimaryKeyWarning,
_resourceManager.GetString("LogMissingPrimaryKey")));
/// <summary>
/// Found table with name: {name}.
/// </summary>
public static readonly EventDefinition<string> LogFoundTable
= new EventDefinition<string>(
RelationalDesignEventId.TableFound,
LogLevel.Debug,
LoggerMessage.Define<string>(
LogLevel.Debug,
RelationalDesignEventId.TableFound,
_resourceManager.GetString("LogFoundTable")));
/// <summary>
/// Table {tableName} is not included in the selection set. Skipping.
/// </summary>
public static readonly EventDefinition<string> LogTableNotInSelectionSet
= new EventDefinition<string>(
RelationalDesignEventId.TableSkipped,
LogLevel.Debug,
LoggerMessage.Define<string>(
LogLevel.Debug,
RelationalDesignEventId.TableSkipped,
_resourceManager.GetString("LogTableNotInSelectionSet")));
/// <summary>
/// Column {columnName} belongs to table {tableName} which is not included in the selection set. Skipping.
/// </summary>
public static readonly EventDefinition<string, string> LogColumnNotInSelectionSet
= new EventDefinition<string, string>(
RelationalDesignEventId.ColumnSkipped,
LogLevel.Debug,
LoggerMessage.Define<string, string>(
LogLevel.Debug,
RelationalDesignEventId.ColumnSkipped,
_resourceManager.GetString("LogColumnNotInSelectionSet")));
/// <summary>
/// Found index with name: {indexName}, table: {tableName}, is unique: {isUnique}.
/// </summary>
public static readonly EventDefinition<string, string, bool?> LogFoundIndex
= new EventDefinition<string, string, bool?>(
RelationalDesignEventId.IndexFound,
LogLevel.Debug,
LoggerMessage.Define<string, string, bool?>(
LogLevel.Debug,
RelationalDesignEventId.IndexFound,
_resourceManager.GetString("LogFoundIndex")));
/// <summary>
/// Found index column on index {indexName} on table {tableName}, column name: {columnName}, ordinal: {ordinal}.
/// </summary>
public static readonly EventDefinition<string, string, string, int?> LogFoundIndexColumn
= new EventDefinition<string, string, string, int?>(
RelationalDesignEventId.IndexColumnFound,
LogLevel.Debug,
LoggerMessage.Define<string, string, string, int?>(
LogLevel.Debug,
RelationalDesignEventId.IndexColumnFound,
_resourceManager.GetString("LogFoundIndexColumn")));
/// <summary>
/// Index column {columnName} belongs to index {indexName} on table {tableName} which is not included in the selection set. Skipping.
/// </summary>
public static readonly EventDefinition<string, string, string> LogIndexColumnNotInSelectionSet
= new EventDefinition<string, string, string>(
RelationalDesignEventId.IndexColumnSkipped,
LogLevel.Warning,
LoggerMessage.Define<string, string, string>(
LogLevel.Warning,
RelationalDesignEventId.IndexColumnSkipped,
_resourceManager.GetString("LogIndexColumnNotInSelectionSet")));
/// <summary>
/// Found sequence name: {name}, data type: {dataType}, cyclic: {isCyclic}, increment: {increment}, start: {start}, minimum: {min}, maximum: {max}.
/// </summary>
public static readonly FallbackEventDefinition LogFoundSequence
= new FallbackEventDefinition(
RelationalDesignEventId.SequenceFound,
LogLevel.Debug,
_resourceManager.GetString("LogFoundSequence"));
/// <summary>
/// Found a column on foreign key {tableName}.{fkName} with an empty or null name. Not including column in foreign key
/// </summary>
public static readonly EventDefinition<string, string> LogColumnNameEmptyOnForeignKey
= new EventDefinition<string, string>(
RelationalDesignEventId.ForeignKeyColumnNotNamedWarning,
LogLevel.Warning,
LoggerMessage.Define<string, string>(
LogLevel.Warning,
RelationalDesignEventId.ForeignKeyColumnNotNamedWarning,
_resourceManager.GetString("LogColumnNameEmptyOnForeignKey")));
/// <summary>
/// Found a column on table {tableName} with an empty or null name. Skipping column.
/// </summary>
public static readonly EventDefinition<string> LogColumnNameEmptyOnTable
= new EventDefinition<string>(
RelationalDesignEventId.ColumnNotNamedWarning,
LogLevel.Warning,
LoggerMessage.Define<string>(
LogLevel.Warning,
RelationalDesignEventId.ColumnNotNamedWarning,
_resourceManager.GetString("LogColumnNameEmptyOnTable")));
/// <summary>
/// For index {indexName}. Unable to find parent table {tableName}. Skipping index.
/// </summary>
public static readonly EventDefinition<string, string> LogUnableToFindTableForIndex
= new EventDefinition<string, string>(
RelationalDesignEventId.IndexTableMissingWarning,
LogLevel.Warning,
LoggerMessage.Define<string, string>(
LogLevel.Warning,
RelationalDesignEventId.IndexTableMissingWarning,
_resourceManager.GetString("LogUnableToFindTableForIndex")));
/// <summary>
/// Found an index on table {tableName} with an empty or null name. Skipping index.
/// </summary>
public static readonly EventDefinition<string> LogIndexNameEmpty
= new EventDefinition<string>(
RelationalDesignEventId.IndexNotNamedWarning,
LogLevel.Warning,
LoggerMessage.Define<string>(
LogLevel.Warning,
RelationalDesignEventId.IndexNotNamedWarning,
_resourceManager.GetString("LogIndexNameEmpty")));
/// <summary>
/// Found a foreign key on table {tableName} with an empty or null name. Skipping foreign key.
/// </summary>
public static readonly EventDefinition<string> LogForeignKeyNameEmpty
= new EventDefinition<string>(
RelationalDesignEventId.ForeignKeyNotNamedWarning,
LogLevel.Warning,
LoggerMessage.Define<string>(
LogLevel.Warning,
RelationalDesignEventId.ForeignKeyNotNamedWarning,
_resourceManager.GetString("LogForeignKeyNameEmpty")));
/// <summary>
/// Foreign key column {columnName} belongs to foreign key {fkName} on table {tableName} which is not included in the selection set. Skipping.
/// </summary>
public static readonly EventDefinition<string, string, string> LogForeignKeyColumnNotInSelectionSet
= new EventDefinition<string, string, string>(
RelationalDesignEventId.ForeignKeyColumnMissingWarning,
LogLevel.Warning,
LoggerMessage.Define<string, string, string>(
LogLevel.Warning,
RelationalDesignEventId.ForeignKeyColumnMissingWarning,
_resourceManager.GetString("LogForeignKeyColumnNotInSelectionSet")));
/// <summary>
/// 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.
/// </summary>
public static readonly EventDefinition<string, string, string> LogPrincipalTableNotInSelectionSet
= new EventDefinition<string, string, string>(
RelationalDesignEventId.ForeignKeyReferencesMissingPrincipalTableWarning,
LogLevel.Warning,
LoggerMessage.Define<string, string, string>(
LogLevel.Warning,
RelationalDesignEventId.ForeignKeyReferencesMissingPrincipalTableWarning,
_resourceManager.GetString("LogPrincipalTableNotInSelectionSet")));
/// <summary>
/// Unable to generate entity type for table '{tableName}'.
/// </summary>
public static readonly EventDefinition<string> LogUnableToGenerateEntityType
= new EventDefinition<string>(
RelationalDesignEventId.UnableToGenerateEntityTypeWarning,
LogLevel.Warning,
LoggerMessage.Define<string>(
LogLevel.Warning,
RelationalDesignEventId.UnableToGenerateEntityTypeWarning,
_resourceManager.GetString("LogUnableToGenerateEntityType")));
/// <summary>
/// Unable to scaffold the index '{indexName}'. The following columns could not be scaffolded: {columnNames}.
/// </summary>
public static readonly EventDefinition<string, string> LogUnableToScaffoldIndexMissingProperty
= new EventDefinition<string, string>(
RelationalDesignEventId.IndexColumnsNotMappedWarning,
LogLevel.Warning,
LoggerMessage.Define<string, string>(
LogLevel.Warning,
RelationalDesignEventId.IndexColumnsNotMappedWarning,
_resourceManager.GetString("LogUnableToScaffoldIndexMissingProperty")));
/// <summary>
/// Sequence name cannot be null or empty. Entity Framework cannot model a sequence that does not have a name.
/// </summary>
public static readonly EventDefinition LogSequencesRequireName
= new EventDefinition(
RelationalDesignEventId.SequenceNotNamedWarning,
LogLevel.Warning,
LoggerMessage.Define(
LogLevel.Warning,
RelationalDesignEventId.SequenceNotNamedWarning,
_resourceManager.GetString("LogSequencesRequireName")));
/// <summary>
/// For sequence '{sequenceName}'. Unable to scaffold because it uses an unsupported type: '{typeName}'.
/// </summary>
public static readonly EventDefinition<string, string> LogBadSequenceType
= new EventDefinition<string, string>(
RelationalDesignEventId.SequenceTypeNotSupportedWarning,
LogLevel.Warning,
LoggerMessage.Define<string, string>(
LogLevel.Warning,
RelationalDesignEventId.SequenceTypeNotSupportedWarning,
_resourceManager.GetString("LogBadSequenceType")));
/// <summary>
/// Unable to find a schema in the database matching the selected schema {schema}.
/// </summary>
public static readonly EventDefinition<string> LogMissingSchema
= new EventDefinition<string>(
RelationalDesignEventId.MissingSchemaWarning,
LogLevel.Warning,
LoggerMessage.Define<string>(
LogLevel.Warning,
RelationalDesignEventId.MissingSchemaWarning,
_resourceManager.GetString("LogMissingSchema")));
/// <summary>
/// Unable to find a table in the database matching the selected table {table}.
/// </summary>
public static readonly EventDefinition<string> LogMissingTable
= new EventDefinition<string>(
RelationalDesignEventId.MissingTableWarning,
LogLevel.Warning,
LoggerMessage.Define<string>(
LogLevel.Warning,
RelationalDesignEventId.MissingTableWarning,
_resourceManager.GetString("LogMissingTable")));
/// <summary>
/// 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.
/// </summary>
public static readonly EventDefinition<string, string, string> LogForeignKeyPrincipalEndContainsNullableColumns
= new EventDefinition<string, string, string>(
RelationalDesignEventId.ForeignKeyPrincipalEndContainsNullableColumnsWarning,
LogLevel.Warning,
LoggerMessage.Define<string, string, string>(
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;
}
}
}

Просмотреть файл

@ -1,4 +0,0 @@
<#
Session["ResourceFile"] = "RelationalDesignStrings.resx";
#>
<#@ include file="..\..\..\tools\Resources.tt" #>

Просмотреть файл

@ -1,249 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="ProviderReturnedNullModel" xml:space="preserve">
<value>Metadata model returned should not be null. Provider: {providerTypeName}.</value>
</data>
<data name="ReadOnlyFiles" xml:space="preserve">
<value>No files generated in directory {outputDirectoryName}. The following file(s) already exist and must be made writeable to continue: {readOnlyFiles}.</value>
</data>
<data name="ExistingFiles" xml:space="preserve">
<value>The following file(s) already exist in directory {outputDirectoryName}: {existingFiles}. Use the Force flag to overwrite these files.</value>
</data>
<data name="LogColumnNameEmptyOnIndex" xml:space="preserve">
<value>Found a column on index {indexName} on table {tableName} with an empty or null name. Not including column in index.</value>
<comment>Warning RelationalDesignEventId.IndexColumnNotNamedWarning string string</comment>
</data>
<data name="LogPrincipalColumnNotFound" xml:space="preserve">
<value>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.</value>
<comment>Warning RelationalDesignEventId.ForeignKeyPrincipalColumnMissingWarning string string string string</comment>
</data>
<data name="LogCannotFindTypeMappingForColumn" xml:space="preserve">
<value>Could not find type mapping for column '{columnName}' with data type '{dateType}'. Skipping column.</value>
<comment>Warning RelationalDesignEventId.ColumnTypeNotMappedWarning string string</comment>
</data>
<data name="LogForeignKeyScaffoldErrorPrincipalKeyNotFound" xml:space="preserve">
<value>Could not scaffold the foreign key '{foreignKeyName}'. A key for '{columnsList}' was not found in the principal entity type '{principalEntityType}'.</value>
<comment>Warning RelationalDesignEventId.ForeignKeyReferencesMissingPrincipalKeyWarning string string string</comment>
</data>
<data name="LogForeignKeyScaffoldErrorPrincipalTableNotFound" xml:space="preserve">
<value>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.</value>
<comment>Warning RelationalDesignEventId.ForeignKeyReferencesMissingTableWarning string</comment>
</data>
<data name="LogForeignKeyScaffoldErrorPrincipalTableScaffoldingError" xml:space="preserve">
<value>Could not scaffold the foreign key '{foreignKeyName}'. The referenced table '{principaltableName}' could not be scaffolded.</value>
<comment>Warning RelationalDesignEventId.ForeignKeyReferencesNotMappedTableWarning string string</comment>
</data>
<data name="LogForeignKeyScaffoldErrorPropertyNotFound" xml:space="preserve">
<value>Could not scaffold the foreign key '{foreignKeyName}'. The following columns in the foreign key could not be scaffolded: {columnNames}.</value>
<comment>Warning RelationalDesignEventId.ForeignKeyColumnsNotMappedWarning string string</comment>
</data>
<data name="LogPrimaryKeyErrorPropertyNotFound" xml:space="preserve">
<value>Could not scaffold the primary key for '{tableName}'. The following columns in the primary key could not be scaffolded: {columnNames}.</value>
<comment>Warning RelationalDesignEventId.PrimaryKeyColumnsNotMappedWarning string string</comment>
</data>
<data name="LogMissingPrimaryKey" xml:space="preserve">
<value>Unable to identify the primary key for table '{tableName}'.</value>
<comment>Warning RelationalDesignEventId.MissingPrimaryKeyWarning string</comment>
</data>
<data name="LogFoundTable" xml:space="preserve">
<value>Found table with name: {name}.</value>
<comment>Debug RelationalDesignEventId.TableFound string</comment>
</data>
<data name="LogTableNotInSelectionSet" xml:space="preserve">
<value>Table {tableName} is not included in the selection set. Skipping.</value>
<comment>Debug RelationalDesignEventId.TableSkipped string</comment>
</data>
<data name="LogColumnNotInSelectionSet" xml:space="preserve">
<value>Column {columnName} belongs to table {tableName} which is not included in the selection set. Skipping.</value>
<comment>Debug RelationalDesignEventId.ColumnSkipped string string</comment>
</data>
<data name="LogFoundIndex" xml:space="preserve">
<value>Found index with name: {indexName}, table: {tableName}, is unique: {isUnique}.</value>
<comment>Debug RelationalDesignEventId.IndexFound string string bool?</comment>
</data>
<data name="LogFoundIndexColumn" xml:space="preserve">
<value>Found index column on index {indexName} on table {tableName}, column name: {columnName}, ordinal: {ordinal}.</value>
<comment>Debug RelationalDesignEventId.IndexColumnFound string string string int?</comment>
</data>
<data name="LogIndexColumnNotInSelectionSet" xml:space="preserve">
<value>Index column {columnName} belongs to index {indexName} on table {tableName} which is not included in the selection set. Skipping.</value>
<comment>Warning RelationalDesignEventId.IndexColumnSkipped string string string</comment>
</data>
<data name="LogFoundSequence" xml:space="preserve">
<value>Found sequence name: {name}, data type: {dataType}, cyclic: {isCyclic}, increment: {increment}, start: {start}, minimum: {min}, maximum: {max}.</value>
<comment>Debug RelationalDesignEventId.SequenceFound string string bool? int? long? long? long?</comment>
</data>
<data name="LogColumnNameEmptyOnForeignKey" xml:space="preserve">
<value>Found a column on foreign key {tableName}.{fkName} with an empty or null name. Not including column in foreign key</value>
<comment>Warning RelationalDesignEventId.ForeignKeyColumnNotNamedWarning string string</comment>
</data>
<data name="LogColumnNameEmptyOnTable" xml:space="preserve">
<value>Found a column on table {tableName} with an empty or null name. Skipping column.</value>
<comment>Warning RelationalDesignEventId.ColumnNotNamedWarning string</comment>
</data>
<data name="LogUnableToFindTableForIndex" xml:space="preserve">
<value>For index {indexName}. Unable to find parent table {tableName}. Skipping index.</value>
<comment>Warning RelationalDesignEventId.IndexTableMissingWarning string string</comment>
</data>
<data name="LogIndexNameEmpty" xml:space="preserve">
<value>Found an index on table {tableName} with an empty or null name. Skipping index.</value>
<comment>Warning RelationalDesignEventId.IndexNotNamedWarning string</comment>
</data>
<data name="LogForeignKeyNameEmpty" xml:space="preserve">
<value>Found a foreign key on table {tableName} with an empty or null name. Skipping foreign key.</value>
<comment>Warning RelationalDesignEventId.ForeignKeyNotNamedWarning string</comment>
</data>
<data name="LogForeignKeyColumnNotInSelectionSet" xml:space="preserve">
<value>Foreign key column {columnName} belongs to foreign key {fkName} on table {tableName} which is not included in the selection set. Skipping.</value>
<comment>Warning RelationalDesignEventId.ForeignKeyColumnMissingWarning string string string</comment>
</data>
<data name="LogPrincipalTableNotInSelectionSet" xml:space="preserve">
<value>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.</value>
<comment>Warning RelationalDesignEventId.ForeignKeyReferencesMissingPrincipalTableWarning string string string</comment>
</data>
<data name="LogUnableToGenerateEntityType" xml:space="preserve">
<value>Unable to generate entity type for table '{tableName}'.</value>
<comment>Warning RelationalDesignEventId.UnableToGenerateEntityTypeWarning string</comment>
</data>
<data name="LogUnableToScaffoldIndexMissingProperty" xml:space="preserve">
<value>Unable to scaffold the index '{indexName}'. The following columns could not be scaffolded: {columnNames}.</value>
<comment>Warning RelationalDesignEventId.IndexColumnsNotMappedWarning string string</comment>
</data>
<data name="LogSequencesRequireName" xml:space="preserve">
<value>Sequence name cannot be null or empty. Entity Framework cannot model a sequence that does not have a name.</value>
<comment>Warning RelationalDesignEventId.SequenceNotNamedWarning</comment>
</data>
<data name="LogBadSequenceType" xml:space="preserve">
<value>For sequence '{sequenceName}'. Unable to scaffold because it uses an unsupported type: '{typeName}'.</value>
<comment>Warning RelationalDesignEventId.SequenceTypeNotSupportedWarning string string</comment>
</data>
<data name="LogMissingSchema" xml:space="preserve">
<value>Unable to find a schema in the database matching the selected schema {schema}.</value>
<comment>Warning RelationalDesignEventId.MissingSchemaWarning string</comment>
</data>
<data name="LogMissingTable" xml:space="preserve">
<value>Unable to find a table in the database matching the selected table {table}.</value>
<comment>Warning RelationalDesignEventId.MissingTableWarning string</comment>
</data>
<data name="LogForeignKeyPrincipalEndContainsNullableColumns" xml:space="preserve">
<value>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.</value>
<comment>Warning RelationalDesignEventId.ForeignKeyPrincipalEndContainsNullableColumnsWarning string string string</comment>
</data>
</root>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -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"
}
]

Просмотреть файл

@ -15,7 +15,6 @@
<ItemGroup>
<ProjectReference Include="..\EFCore.Relational\EFCore.Relational.csproj" />
<ProjectReference Include="..\EFCore.Relational.Design\EFCore.Relational.Design.csproj" />
<ProjectReference Include="..\EFCore.Specification.Tests\EFCore.Specification.Tests.csproj" />
</ItemGroup>

Просмотреть файл

@ -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
/// </para>
/// </summary>
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);
/// <summary>
/// The database is missing a table.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId MissingTableWarning = MakeScaffoldingId(Id.MissingTableWarning);
/// <summary>
/// The database has an unnamed sequence.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId SequenceNotNamedWarning = MakeScaffoldingId(Id.SequenceNotNamedWarning);
/// <summary>
/// Columns in an index were not mapped.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId IndexColumnsNotMappedWarning = MakeScaffoldingId(Id.IndexColumnsNotMappedWarning);
/// <summary>
/// A foreign key references a missing table.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId ForeignKeyReferencesMissingTableWarning = MakeScaffoldingId(Id.ForeignKeyReferencesMissingTableWarning);
/// <summary>
/// A foreign key references a missing table at the principal end.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId ForeignKeyReferencesMissingPrincipalTableWarning = MakeScaffoldingId(Id.ForeignKeyReferencesMissingPrincipalTableWarning);
/// <summary>
/// Columns in a foreign key were not mapped.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId ForeignKeyColumnsNotMappedWarning = MakeScaffoldingId(Id.ForeignKeyColumnsNotMappedWarning);
/// <summary>
/// A foreign key is not named.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId ForeignKeyNotNamedWarning = MakeScaffoldingId(Id.ForeignKeyNotNamedWarning);
/// <summary>
/// A foreign key column was not found.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId ForeignKeyColumnMissingWarning = MakeScaffoldingId(Id.ForeignKeyColumnMissingWarning);
/// <summary>
/// A column referenced by a foreign key constraint was not found.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId ForeignKeyPrincipalColumnMissingWarning = MakeScaffoldingId(Id.ForeignKeyPrincipalColumnMissingWarning);
/// <summary>
/// A foreign key column was not named.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId ForeignKeyColumnNotNamedWarning = MakeScaffoldingId(Id.ForeignKeyColumnNotNamedWarning);
/// <summary>
/// A column is not named.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId ColumnNotNamedWarning = MakeScaffoldingId(Id.ColumnNotNamedWarning);
/// <summary>
/// An index is not named.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId IndexNotNamedWarning = MakeScaffoldingId(Id.IndexNotNamedWarning);
/// <summary>
/// The table referened by an index was not found.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId IndexTableMissingWarning = MakeScaffoldingId(Id.IndexTableMissingWarning);
/// <summary>
/// An index column was not named.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId IndexColumnNotNamedWarning = MakeScaffoldingId(Id.IndexColumnNotNamedWarning);
/// <summary>
/// A table was found.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId TableFound = MakeScaffoldingId(Id.TableFound);
/// <summary>
/// A table was skipped.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId TableSkipped = MakeScaffoldingId(Id.TableSkipped);
/// <summary>
/// A column was skipped.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId ColumnSkipped = MakeScaffoldingId(Id.ColumnSkipped);
/// <summary>
/// An index was found.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId IndexFound = MakeScaffoldingId(Id.IndexFound);
/// <summary>
/// An index was skipped.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId IndexColumnFound = MakeScaffoldingId(Id.IndexColumnFound);
/// <summary>
/// A column of an index was skipped.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId IndexColumnSkipped = MakeScaffoldingId(Id.IndexColumnSkipped);
/// <summary>
/// A sequence was found.
/// This event is in the <see cref="DbLoggerCategory.Scaffolding" /> category.
/// </summary>
public static readonly EventId SequenceFound = MakeScaffoldingId(Id.SequenceFound);
}
}

Просмотреть файл

@ -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());
}
/// <summary>
/// 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.
/// </summary>
public static void MissingTableWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void SequenceNotNamedWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> diagnostics)
{
var definition = RelationalStrings.LogSequencesRequireName;
definition.Log(diagnostics);
if (diagnostics.DiagnosticSource.IsEnabled(definition.EventId.Name))
{
diagnostics.DiagnosticSource.Write(definition.EventId.Name, null);
}
}
/// <summary>
/// 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.
/// </summary>
public static void IndexColumnsNotMappedWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> diagnostics,
[CanBeNull] string indexName,
[NotNull] IList<string> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void ForeignKeyReferencesMissingTableWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void ForeignKeyColumnsNotMappedWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> diagnostics,
[CanBeNull] string foreignKeyName,
[NotNull] IList<string> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void SequenceFound(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void TableFound(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void TableSkipped(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void ColumnSkipped(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void IndexColumnFound(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void ColumnNotNamedWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void IndexColumnSkipped(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void IndexNotNamedWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void IndexTableMissingWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void IndexColumnNotNamedWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void ForeignKeyNotNamedWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void ForeignKeyColumnMissingWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void ForeignKeyReferencesMissingPrincipalTableWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void ForeignKeyColumnNotNamedWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void IndexFound(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
/// <summary>
/// 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.
/// </summary>
public static void ForeignKeyPrincipalColumnMissingWarning(
[NotNull] this IDiagnosticsLogger<DbLoggerCategory.Scaffolding> 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
});
}
}
}
}

Просмотреть файл

@ -770,6 +770,255 @@ namespace Microsoft.EntityFrameworkCore.Internal
GetString("UnsupportedPropertyType", nameof(entity), nameof(property), nameof(clrType)),
entity, property, clrType);
/// <summary>
/// Found sequence name: {name}, data type: {dataType}, cyclic: {isCyclic}, increment: {increment}, start: {start}, minimum: {min}, maximum: {max}.
/// </summary>
public static readonly FallbackEventDefinition LogFoundSequence
= new FallbackEventDefinition(
RelationalEventId.SequenceFound,
LogLevel.Debug,
_resourceManager.GetString("LogFoundSequence"));
/// <summary>
/// Sequence name cannot be null or empty. Entity Framework cannot model a sequence that does not have a name.
/// </summary>
public static readonly EventDefinition LogSequencesRequireName
= new EventDefinition(
RelationalEventId.SequenceNotNamedWarning,
LogLevel.Warning,
LoggerMessage.Define(
LogLevel.Warning,
RelationalEventId.SequenceNotNamedWarning,
_resourceManager.GetString("LogSequencesRequireName")));
/// <summary>
/// Found table with name: {name}.
/// </summary>
public static readonly EventDefinition<string> LogFoundTable
= new EventDefinition<string>(
RelationalEventId.TableFound,
LogLevel.Debug,
LoggerMessage.Define<string>(
LogLevel.Debug,
RelationalEventId.TableFound,
_resourceManager.GetString("LogFoundTable")));
/// <summary>
/// Table {tableName} is not included in the selection set. Skipping.
/// </summary>
public static readonly EventDefinition<string> LogTableNotInSelectionSet
= new EventDefinition<string>(
RelationalEventId.TableSkipped,
LogLevel.Debug,
LoggerMessage.Define<string>(
LogLevel.Debug,
RelationalEventId.TableSkipped,
_resourceManager.GetString("LogTableNotInSelectionSet")));
/// <summary>
/// Column {columnName} belongs to table {tableName} which is not included in the selection set. Skipping.
/// </summary>
public static readonly EventDefinition<string, string> LogColumnNotInSelectionSet
= new EventDefinition<string, string>(
RelationalEventId.ColumnSkipped,
LogLevel.Debug,
LoggerMessage.Define<string, string>(
LogLevel.Debug,
RelationalEventId.ColumnSkipped,
_resourceManager.GetString("LogColumnNotInSelectionSet")));
/// <summary>
/// Found a column on table {tableName} with an empty or null name. Skipping column.
/// </summary>
public static readonly EventDefinition<string> LogColumnNameEmptyOnTable
= new EventDefinition<string>(
RelationalEventId.ColumnNotNamedWarning,
LogLevel.Warning,
LoggerMessage.Define<string>(
LogLevel.Warning,
RelationalEventId.ColumnNotNamedWarning,
_resourceManager.GetString("LogColumnNameEmptyOnTable")));
/// <summary>
/// Unable to find a table in the database matching the selected table {table}.
/// </summary>
public static readonly EventDefinition<string> LogMissingTable
= new EventDefinition<string>(
RelationalEventId.MissingTableWarning,
LogLevel.Warning,
LoggerMessage.Define<string>(
LogLevel.Warning,
RelationalEventId.MissingTableWarning,
_resourceManager.GetString("LogMissingTable")));
/// <summary>
/// Found index column on index {indexName} on table {tableName}, column name: {columnName}, ordinal: {ordinal}.
/// </summary>
public static readonly EventDefinition<string, string, string, int?> LogFoundIndexColumn
= new EventDefinition<string, string, string, int?>(
RelationalEventId.IndexColumnFound,
LogLevel.Debug,
LoggerMessage.Define<string, string, string, int?>(
LogLevel.Debug,
RelationalEventId.IndexColumnFound,
_resourceManager.GetString("LogFoundIndexColumn")));
/// <summary>
/// Index column {columnName} belongs to index {indexName} on table {tableName} which is not included in the selection set. Skipping.
/// </summary>
public static readonly EventDefinition<string, string, string> LogIndexColumnNotInSelectionSet
= new EventDefinition<string, string, string>(
RelationalEventId.IndexColumnSkipped,
LogLevel.Warning,
LoggerMessage.Define<string, string, string>(
LogLevel.Warning,
RelationalEventId.IndexColumnSkipped,
_resourceManager.GetString("LogIndexColumnNotInSelectionSet")));
/// <summary>
/// Found an index on table {tableName} with an empty or null name. Skipping index.
/// </summary>
public static readonly EventDefinition<string> LogIndexNameEmpty
= new EventDefinition<string>(
RelationalEventId.IndexNotNamedWarning,
LogLevel.Warning,
LoggerMessage.Define<string>(
LogLevel.Warning,
RelationalEventId.IndexNotNamedWarning,
_resourceManager.GetString("LogIndexNameEmpty")));
/// <summary>
/// For index {indexName}. Unable to find parent table {tableName}. Skipping index.
/// </summary>
public static readonly EventDefinition<string, string> LogUnableToFindTableForIndex
= new EventDefinition<string, string>(
RelationalEventId.IndexTableMissingWarning,
LogLevel.Warning,
LoggerMessage.Define<string, string>(
LogLevel.Warning,
RelationalEventId.IndexTableMissingWarning,
_resourceManager.GetString("LogUnableToFindTableForIndex")));
/// <summary>
/// Found a column on index {indexName} on table {tableName} with an empty or null name. Not including column in index.
/// </summary>
public static readonly EventDefinition<string, string> LogColumnNameEmptyOnIndex
= new EventDefinition<string, string>(
RelationalEventId.IndexColumnNotNamedWarning,
LogLevel.Warning,
LoggerMessage.Define<string, string>(
LogLevel.Warning,
RelationalEventId.IndexColumnNotNamedWarning,
_resourceManager.GetString("LogColumnNameEmptyOnIndex")));
/// <summary>
/// Unable to scaffold the index '{indexName}'. The following columns could not be scaffolded: {columnNames}.
/// </summary>
public static readonly EventDefinition<string, string> LogUnableToScaffoldIndexMissingProperty
= new EventDefinition<string, string>(
RelationalEventId.IndexColumnsNotMappedWarning,
LogLevel.Warning,
LoggerMessage.Define<string, string>(
LogLevel.Warning,
RelationalEventId.IndexColumnsNotMappedWarning,
_resourceManager.GetString("LogUnableToScaffoldIndexMissingProperty")));
/// <summary>
/// Found a foreign key on table {tableName} with an empty or null name. Skipping foreign key.
/// </summary>
public static readonly EventDefinition<string> LogForeignKeyNameEmpty
= new EventDefinition<string>(
RelationalEventId.ForeignKeyNotNamedWarning,
LogLevel.Warning,
LoggerMessage.Define<string>(
LogLevel.Warning,
RelationalEventId.ForeignKeyNotNamedWarning,
_resourceManager.GetString("LogForeignKeyNameEmpty")));
/// <summary>
/// Foreign key column {columnName} belongs to foreign key {fkName} on table {tableName} which is not included in the selection set. Skipping.
/// </summary>
public static readonly EventDefinition<string, string, string> LogForeignKeyColumnNotInSelectionSet
= new EventDefinition<string, string, string>(
RelationalEventId.ForeignKeyColumnMissingWarning,
LogLevel.Warning,
LoggerMessage.Define<string, string, string>(
LogLevel.Warning,
RelationalEventId.ForeignKeyColumnMissingWarning,
_resourceManager.GetString("LogForeignKeyColumnNotInSelectionSet")));
/// <summary>
/// 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.
/// </summary>
public static readonly EventDefinition<string, string, string> LogPrincipalTableNotInSelectionSet
= new EventDefinition<string, string, string>(
RelationalEventId.ForeignKeyReferencesMissingPrincipalTableWarning,
LogLevel.Warning,
LoggerMessage.Define<string, string, string>(
LogLevel.Warning,
RelationalEventId.ForeignKeyReferencesMissingPrincipalTableWarning,
_resourceManager.GetString("LogPrincipalTableNotInSelectionSet")));
/// <summary>
/// Found a column on foreign key {tableName}.{fkName} with an empty or null name. Not including column in foreign key
/// </summary>
public static readonly EventDefinition<string, string> LogColumnNameEmptyOnForeignKey
= new EventDefinition<string, string>(
RelationalEventId.ForeignKeyColumnNotNamedWarning,
LogLevel.Warning,
LoggerMessage.Define<string, string>(
LogLevel.Warning,
RelationalEventId.ForeignKeyColumnNotNamedWarning,
_resourceManager.GetString("LogColumnNameEmptyOnForeignKey")));
/// <summary>
/// Could not scaffold the foreign key '{foreignKeyName}'. The following columns in the foreign key could not be scaffolded: {columnNames}.
/// </summary>
public static readonly EventDefinition<string, string> LogForeignKeyScaffoldErrorPropertyNotFound
= new EventDefinition<string, string>(
RelationalEventId.ForeignKeyColumnsNotMappedWarning,
LogLevel.Warning,
LoggerMessage.Define<string, string>(
LogLevel.Warning,
RelationalEventId.ForeignKeyColumnsNotMappedWarning,
_resourceManager.GetString("LogForeignKeyScaffoldErrorPropertyNotFound")));
/// <summary>
/// Found index with name: {indexName}, table: {tableName}, is unique: {isUnique}.
/// </summary>
public static readonly EventDefinition<string, string, bool?> LogFoundIndex
= new EventDefinition<string, string, bool?>(
RelationalEventId.IndexFound,
LogLevel.Debug,
LoggerMessage.Define<string, string, bool?>(
LogLevel.Debug,
RelationalEventId.IndexFound,
_resourceManager.GetString("LogFoundIndex")));
/// <summary>
/// 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.
/// </summary>
public static readonly EventDefinition<string> LogForeignKeyScaffoldErrorPrincipalTableNotFound
= new EventDefinition<string>(
RelationalEventId.ForeignKeyReferencesMissingTableWarning,
LogLevel.Warning,
LoggerMessage.Define<string>(
LogLevel.Warning,
RelationalEventId.ForeignKeyReferencesMissingTableWarning,
_resourceManager.GetString("LogForeignKeyScaffoldErrorPrincipalTableNotFound")));
/// <summary>
/// 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.
/// </summary>
public static readonly EventDefinition<string, string, string, string> LogPrincipalColumnNotFound
= new EventDefinition<string, string, string, string>(
RelationalEventId.ForeignKeyPrincipalColumnMissingWarning,
LogLevel.Warning,
LoggerMessage.Define<string, string, string, string>(
LogLevel.Warning,
RelationalEventId.ForeignKeyPrincipalColumnMissingWarning,
_resourceManager.GetString("LogPrincipalColumnNotFound")));
private static string GetString(string name, params string[] formatterNames)
{
var value = _resourceManager.GetString(name);

Просмотреть файл

@ -396,4 +396,89 @@
<data name="UnsupportedPropertyType" xml:space="preserve">
<value>No mapping to a relational type can be found for property '{entity}.{property}' with the CLR type '{clrType}'.</value>
</data>
<data name="LogFoundSequence" xml:space="preserve">
<value>Found sequence name: {name}, data type: {dataType}, cyclic: {isCyclic}, increment: {increment}, start: {start}, minimum: {min}, maximum: {max}.</value>
<comment>Debug RelationalEventId.SequenceFound string string bool? int? long? long? long?</comment>
</data>
<data name="LogSequencesRequireName" xml:space="preserve">
<value>Sequence name cannot be null or empty. Entity Framework cannot model a sequence that does not have a name.</value>
<comment>Warning RelationalEventId.SequenceNotNamedWarning</comment>
</data>
<data name="LogFoundTable" xml:space="preserve">
<value>Found table with name: {name}.</value>
<comment>Debug RelationalEventId.TableFound string</comment>
</data>
<data name="LogTableNotInSelectionSet" xml:space="preserve">
<value>Table {tableName} is not included in the selection set. Skipping.</value>
<comment>Debug RelationalEventId.TableSkipped string</comment>
</data>
<data name="LogColumnNotInSelectionSet" xml:space="preserve">
<value>Column {columnName} belongs to table {tableName} which is not included in the selection set. Skipping.</value>
<comment>Debug RelationalEventId.ColumnSkipped string string</comment>
</data>
<data name="LogColumnNameEmptyOnTable" xml:space="preserve">
<value>Found a column on table {tableName} with an empty or null name. Skipping column.</value>
<comment>Warning RelationalEventId.ColumnNotNamedWarning string</comment>
</data>
<data name="LogMissingTable" xml:space="preserve">
<value>Unable to find a table in the database matching the selected table {table}.</value>
<comment>Warning RelationalEventId.MissingTableWarning string</comment>
</data>
<data name="LogFoundIndexColumn" xml:space="preserve">
<value>Found index column on index {indexName} on table {tableName}, column name: {columnName}, ordinal: {ordinal}.</value>
<comment>Debug RelationalEventId.IndexColumnFound string string string int?</comment>
</data>
<data name="LogIndexColumnNotInSelectionSet" xml:space="preserve">
<value>Index column {columnName} belongs to index {indexName} on table {tableName} which is not included in the selection set. Skipping.</value>
<comment>Warning RelationalEventId.IndexColumnSkipped string string string</comment>
</data>
<data name="LogIndexNameEmpty" xml:space="preserve">
<value>Found an index on table {tableName} with an empty or null name. Skipping index.</value>
<comment>Warning RelationalEventId.IndexNotNamedWarning string</comment>
</data>
<data name="LogUnableToFindTableForIndex" xml:space="preserve">
<value>For index {indexName}. Unable to find parent table {tableName}. Skipping index.</value>
<comment>Warning RelationalEventId.IndexTableMissingWarning string string</comment>
</data>
<data name="LogColumnNameEmptyOnIndex" xml:space="preserve">
<value>Found a column on index {indexName} on table {tableName} with an empty or null name. Not including column in index.</value>
<comment>Warning RelationalEventId.IndexColumnNotNamedWarning string string</comment>
</data>
<data name="LogUnableToScaffoldIndexMissingProperty" xml:space="preserve">
<value>Unable to scaffold the index '{indexName}'. The following columns could not be scaffolded: {columnNames}.</value>
<comment>Warning RelationalEventId.IndexColumnsNotMappedWarning string string</comment>
</data>
<data name="LogForeignKeyNameEmpty" xml:space="preserve">
<value>Found a foreign key on table {tableName} with an empty or null name. Skipping foreign key.</value>
<comment>Warning RelationalEventId.ForeignKeyNotNamedWarning string</comment>
</data>
<data name="LogForeignKeyColumnNotInSelectionSet" xml:space="preserve">
<value>Foreign key column {columnName} belongs to foreign key {fkName} on table {tableName} which is not included in the selection set. Skipping.</value>
<comment>Warning RelationalEventId.ForeignKeyColumnMissingWarning string string string</comment>
</data>
<data name="LogPrincipalTableNotInSelectionSet" xml:space="preserve">
<value>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.</value>
<comment>Warning RelationalEventId.ForeignKeyReferencesMissingPrincipalTableWarning string string string</comment>
</data>
<data name="LogColumnNameEmptyOnForeignKey" xml:space="preserve">
<value>Found a column on foreign key {tableName}.{fkName} with an empty or null name. Not including column in foreign key</value>
<comment>Warning RelationalEventId.ForeignKeyColumnNotNamedWarning string string</comment>
</data>
<data name="LogForeignKeyScaffoldErrorPropertyNotFound" xml:space="preserve">
<value>Could not scaffold the foreign key '{foreignKeyName}'. The following columns in the foreign key could not be scaffolded: {columnNames}.</value>
<comment>Warning RelationalEventId.ForeignKeyColumnsNotMappedWarning string string</comment>
</data>
<data name="LogFoundIndex" xml:space="preserve">
<value>Found index with name: {indexName}, table: {tableName}, is unique: {isUnique}.</value>
<comment>Debug RelationalEventId.IndexFound string string bool?</comment>
</data>
<data name="LogForeignKeyScaffoldErrorPrincipalTableNotFound" xml:space="preserve">
<value>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.</value>
<comment>Warning RelationalEventId.ForeignKeyReferencesMissingTableWarning string</comment>
</data>
<data name="LogPrincipalColumnNotFound" xml:space="preserve">
<value>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.</value>
<comment>Warning RelationalEventId.ForeignKeyPrincipalColumnMissingWarning string string string string</comment>
</data>
</root>

Просмотреть файл

@ -18,7 +18,6 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EFCore.Relational.Design\EFCore.Relational.Design.csproj" />
<ProjectReference Include="..\EFCore.Relational\EFCore.Relational.csproj" />
</ItemGroup>

Просмотреть файл

@ -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("\"", "\"\"") + "\"";
}
}

Просмотреть файл

@ -20,7 +20,6 @@
<ItemGroup>
<ProjectReference Include="..\EFCore.Relational\EFCore.Relational.csproj" />
<ProjectReference Include="..\EFCore.Relational.Design\EFCore.Relational.Design.csproj" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -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("\"", "\"\"") + "\"";
}
}

Просмотреть файл

@ -33,11 +33,6 @@ namespace Microsoft.EntityFrameworkCore.Diagnostics
/// </summary>
public const int RelationalBaseId = 200000;
/// <summary>
/// The lower-bound for event IDs used by any relational database provider design-time and tooling.
/// </summary>
public const int RelationalDesignBaseId = 250000;
/// <summary>
/// The lower-bound for event IDs used only by database providers.
/// </summary>

Просмотреть файл

@ -19,7 +19,7 @@
<ItemGroup>
<ProjectReference Include="..\..\src\EFCore.InMemory\EFCore.InMemory.csproj" />
<ProjectReference Include="..\..\src\EFCore.Relational.Design.Specification.Tests\EFCore.Relational.Design.Specification.Tests.csproj" />
<ProjectReference Include="..\EFCore.Relational.Design.Tests\EFCore.Relational.Design.Tests.csproj" />
<ProjectReference Include="..\EFCore.Relational.Tests\EFCore.Relational.Tests.csproj" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -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")));
}

Просмотреть файл

@ -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;
}
}

Просмотреть файл

@ -1,35 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT' OR '$(CoreOnly)' == 'True'">netcoreapp2.0</TargetFrameworks>
<AssemblyName>Microsoft.EntityFrameworkCore.Relational.Design.Tests</AssemblyName>
<RootNamespace>Microsoft.EntityFrameworkCore</RootNamespace>
</PropertyGroup>
<ItemGroup>
<None Include="..\xunit.runner.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\EFCore.Relational.Design.Specification.Tests\EFCore.Relational.Design.Specification.Tests.csproj" />
<ProjectReference Include="..\EFCore.Relational.Tests\EFCore.Relational.Tests.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(TestSdkVersion)" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>

Просмотреть файл

@ -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<Type, Func<object>>
{
{ typeof(IList<string>), () => new List<string> { "A", "B" } },
{ typeof(string), () => "Fake" }
};
RelationalTestHelpers.Instance.TestEventLogging(
typeof(RelationalDesignEventId),
typeof(RelationalDesignLoggerExtensions),
fakeFactories);
}
}
}

Просмотреть файл

@ -41,6 +41,7 @@ namespace Microsoft.EntityFrameworkCore
var fakeFactories = new Dictionary<Type, Func<object>>
{
{ typeof(string), () => "Fake" },
{ typeof(IList<string>), () => new List<string> { "Fake1", "Fake2" } },
{ typeof(IRelationalConnection), () => new FakeRelationalConnection() },
{ typeof(DbCommand), () => new FakeDbCommand() },
{ typeof(DbTransaction), () => new FakeDbTransaction() },

Просмотреть файл

@ -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")
}
});

Просмотреть файл

@ -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);

Просмотреть файл

@ -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]

Просмотреть файл

@ -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),

Просмотреть файл

@ -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),