Skip to content
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

Entity Framework model validation warning #710

Open
dougwaldron opened this issue Mar 6, 2024 · 2 comments
Open

Entity Framework model validation warning #710

dougwaldron opened this issue Mar 6, 2024 · 2 comments

Comments

@dougwaldron
Copy link
Member

Entity Framework is emitting the following warning when loading a Complaint:

warn: Microsoft.EntityFrameworkCore.Model.Validation[20606]
The entity type 'Complaint.CallerAddress#IncompleteAddress' is an optional dependent using table sharing without any required non shared property that could be used to identify whether the entity exists. If all nullable properties contain a null value in database then an object instance won't be created in the query. Add a required property to create instances with null values for other properties or mark the incoming navigation as required to always create an instance.

The same warning is emitted for the following properties (all Owned properties):

  • Complaint.CallerAddress#IncompleteAddress
  • Complaint.CallerPhoneNumber#PhoneNumber
  • Complaint.CallerSecondaryPhoneNumber#PhoneNumber
  • Complaint.CallerTertiaryPhoneNumber#PhoneNumber
  • Complaint.SourceAddress#IncompleteAddress
  • Complaint.SourcePhoneNumber#PhoneNumber
  • Complaint.SourceSecondaryPhoneNumber#PhoneNumber
  • Complaint.SourceTertiaryPhoneNumber#PhoneNumber
@dougwaldron dougwaldron added the vNext Issues that apply to the planned rebuild label Mar 6, 2024
@dougwaldron dougwaldron moved this to Todo in CTS vNext Project Mar 6, 2024
@dougwaldron
Copy link
Member Author

Maybe (probably) not related to the above warnings, but consider saving Value objects using Complex Types.

@dougwaldron
Copy link
Member Author

Ok, I tried complex types, and I don't think it will work here until dotnet/efcore#31376 is fixed.

@dougwaldron dougwaldron added vNext-v2 and removed vNext Issues that apply to the planned rebuild labels Mar 22, 2024
@dougwaldron dougwaldron moved this from Todo to Later in CTS vNext Project Mar 22, 2024
@dougwaldron dougwaldron added this to the Feature update 3 milestone Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant