-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
54 changed files
with
1,619 additions
and
5,258 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.