-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error for optional dependents sharing table without identifying column #24573
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -550,6 +550,10 @@ | |||||
<value>Opening connection to database '{database}' on server '{server}'.</value> | ||||||
<comment>Debug RelationalEventId.ConnectionOpening string string</comment> | ||||||
</data> | ||||||
<data name="LogOptionalDependentWithoutIdentifyingProperty" xml:space="preserve"> | ||||||
<value>Entity type '{entityType}' is an optional dependent in table sharing without any required non shared property to identify if the entity type exist. If all nullable properties contain null value in database then an object instance won't be materialized in the query.</value> | ||||||
<comment>Error RelationalEventId.ModelValidationOptionalDependentWithoutIdentifyingPropertyWarning string</comment> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
</data> | ||||||
<data name="LogPossibleUnintendedUseOfEquals" xml:space="preserve"> | ||||||
<value>Possible unintended use of method 'Equals' for arguments '{left}' and '{right}' of different types in a query. This comparison will always return false.</value> | ||||||
<comment>Warning RelationalEventId.QueryPossibleUnintendedUseOfEqualsWarning string string</comment> | ||||||
|
@@ -675,6 +679,9 @@ | |||||
<data name="NullTypeMappingInSqlTree" xml:space="preserve"> | ||||||
<value>Expression '{sqlExpression}' in the SQL tree does not have a type mapping assigned.</value> | ||||||
</data> | ||||||
<data name="OptionalDependentWithDependentWithoutIdentifyingProperty" xml:space="preserve"> | ||||||
<value>Entity type '{entityType}' is an optional dependent containing other dependents in table sharing without any required non shared property to identify if the entity type exist. If all nullable properties contain null value in database then an object instance won't be materialized in the query causing nested dependent's values to be lost.</value> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
We might also need to add a fwlink |
||||||
</data> | ||||||
<data name="ParameterNotObjectArray" xml:space="preserve"> | ||||||
<value>Cannot use the value provided for parameter '{parameter}' because it isn't assignable to type object[].</value> | ||||||
</data> | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// 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.Diagnostics; | ||
using Microsoft.EntityFrameworkCore.Metadata; | ||
|
||
namespace Microsoft.EntityFrameworkCore.Diagnostics | ||
{ | ||
/// <summary> | ||
/// A <see cref="DiagnosticSource" /> event payload class for events that have | ||
/// an entity type. | ||
/// </summary> | ||
public class EntityTypeEventData : EventData | ||
{ | ||
/// <summary> | ||
/// Constructs the event payload. | ||
/// </summary> | ||
/// <param name="eventDefinition"> The event definition. </param> | ||
/// <param name="messageGenerator"> A delegate that generates a log message for this event. </param> | ||
/// <param name="entityType"> The entityType. </param> | ||
public EntityTypeEventData( | ||
EventDefinitionBase eventDefinition, | ||
Func<EventDefinitionBase, EventData, string> messageGenerator, | ||
IReadOnlyEntityType entityType) | ||
: base(eventDefinition, messageGenerator) | ||
{ | ||
EntityType = entityType; | ||
} | ||
|
||
/// <summary> | ||
/// The entity type. | ||
/// </summary> | ||
public virtual IReadOnlyEntityType EntityType { get; } | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.