Skip to content

Commit

Permalink
Small updates
Browse files Browse the repository at this point in the history
Fixes #20900
Fixes #20843
Fixes #20837
Fixes #19462
Fixes #18910
  • Loading branch information
ajcvickers committed May 23, 2020
1 parent 9b8a7d0 commit 4ab52e0
Show file tree
Hide file tree
Showing 9 changed files with 252 additions and 141 deletions.
8 changes: 6 additions & 2 deletions src/EFCore.Relational/Design/IAnnotationCodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public interface IAnnotationCodeGenerator
/// </summary>
/// <param name="model"> The <see cref="IModel" />. </param>
/// <param name="annotation"> The <see cref="IAnnotation" />. </param>
/// <returns> True if the annotation is handled by convention; false if code must be generated. </returns>
/// <returns> <see langword="true" /> if the annotation is handled by convention; <see langword="false" /> if code must be generated. </returns>
bool IsHandledByConvention([NotNull] IModel model, [NotNull] IAnnotation annotation);

/// <summary>
Expand All @@ -29,7 +29,7 @@ public interface IAnnotationCodeGenerator
/// </summary>
/// <param name="entityType"> The <see cref="IEntityType" />. </param>
/// <param name="annotation"> The <see cref="IAnnotation" />. </param>
/// <returns> True if the annotation is handled by convention; false if code must be generated. </returns>
/// <returns> <see langword="true" /> if the annotation is handled by convention; <see langword="false" /> if code must be generated. </returns>
bool IsHandledByConvention([NotNull] IEntityType entityType, [NotNull] IAnnotation annotation);

/// <summary>
Expand All @@ -38,6 +38,7 @@ public interface IAnnotationCodeGenerator
/// </summary>
/// <param name="key"> The <see cref="IKey" />. </param>
/// <param name="annotation"> The <see cref="IAnnotation" />. </param>
/// <returns> <see langword="true" /> if the annotation is handled by convention; <see langword="false" /> if code must be generated. </returns>
bool IsHandledByConvention([NotNull] IKey key, [NotNull] IAnnotation annotation);

/// <summary>
Expand All @@ -46,6 +47,7 @@ public interface IAnnotationCodeGenerator
/// </summary>
/// <param name="property"> The <see cref="IProperty" />. </param>
/// <param name="annotation"> The <see cref="IAnnotation" />. </param>
/// <returns> <see langword="true" /> if the annotation is handled by convention; <see langword="false" /> if code must be generated. </returns>
bool IsHandledByConvention([NotNull] IProperty property, [NotNull] IAnnotation annotation);

/// <summary>
Expand All @@ -54,6 +56,7 @@ public interface IAnnotationCodeGenerator
/// </summary>
/// <param name="foreignKey"> The <see cref="IForeignKey" />. </param>
/// <param name="annotation"> The <see cref="IAnnotation" />. </param>
/// <returns> <see langword="true" /> if the annotation is handled by convention; <see langword="false" /> if code must be generated. </returns>
bool IsHandledByConvention([NotNull] IForeignKey foreignKey, [NotNull] IAnnotation annotation);

/// <summary>
Expand All @@ -62,6 +65,7 @@ public interface IAnnotationCodeGenerator
/// </summary>
/// <param name="index"> The <see cref="IIndex" />. </param>
/// <param name="annotation"> The <see cref="IAnnotation" />. </param>
/// <returns> <see langword="true" /> if the annotation is handled by convention; <see langword="false" /> if code must be generated. </returns>
bool IsHandledByConvention([NotNull] IIndex index, [NotNull] IAnnotation annotation);

/// <summary>
Expand Down
14 changes: 14 additions & 0 deletions src/EFCore.Relational/Storage/RelationalDatabaseCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,13 @@ public virtual string GenerateCreateScript()
/// Determines whether or not the database is available and can be connected to.
/// </para>
/// <para>
/// Any exceptions thrown when attempting to connect are caught and not propagated to the application.
/// </para>
/// <para>
/// The configured connection string is used to create the connection in the normal way, so all
/// configured options such as timeouts are honored.
/// </para>
/// <para>
/// Note that being able to connect to the database does not mean that it is
/// up-to-date with regard to schema creation, etc.
/// </para>
Expand All @@ -330,6 +337,13 @@ public virtual bool CanConnect()
/// Determines whether or not the database is available and can be connected to.
/// </para>
/// <para>
/// Any exceptions thrown when attempting to connect are caught and not propagated to the application.
/// </para>
/// <para>
/// The configured connection string is used to create the connection in the normal way, so all
/// configured options such as timeouts are honored.
/// </para>
/// <para>
/// Note that being able to connect to the database does not mean that it is
/// up-to-date with regard to schema creation, etc.
/// </para>
Expand Down
4 changes: 2 additions & 2 deletions src/EFCore/Diagnostics/CoreLoggerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1417,7 +1417,7 @@ public static void RequiredAttributeOnCollection(

if (diagnostics.ShouldLog(definition))
{
definition.Log(diagnostics,navigation.Name,navigation.DeclaringEntityType.DisplayName());
definition.Log(diagnostics, navigation.DeclaringEntityType.DisplayName(), navigation.Name);
}

if (diagnostics.NeedsEventData(definition, out var diagnosticSourceEnabled, out var simpleLogEnabled))
Expand All @@ -1435,7 +1435,7 @@ private static string RequiredAttributeOnCollection(EventDefinitionBase definiti
{
var d = (EventDefinition<string, string>)definition;
var p = (NavigationEventData)payload;
return d.GenerateMessage(p.Navigation.Name, p.Navigation.DeclaringEntityType.DisplayName());
return d.GenerateMessage(p.Navigation.DeclaringEntityType.DisplayName(), p.Navigation.Name);
}

/// <summary>
Expand Down
Loading

0 comments on commit 4ab52e0

Please sign in to comment.