You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get error when updating the entity with primary key 0(zero). How can I fix it?
public class User
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
public int Id { get; set; }
public LocalizedEntity NationalityName { get; set; }
}
[Owned]
public class LocalizedEntity
{
public string Primary { get; set; }
public string Secondary { get; set; }
}
Error:
InvalidOperationException: The value of 'User.NationalityName#LocalizedEntity.UserId' is unknown when attempting to save changes. This is because the property is also part of a foreign key for which the principal entity in the relationship is not known.
EF Core version: 5.0.0
The text was updated successfully, but these errors were encountered:
I get error when updating the entity with primary key 0(zero). How can I fix it?
Error:
InvalidOperationException: The value of 'User.NationalityName#LocalizedEntity.UserId' is unknown when attempting to save changes. This is because the property is also part of a foreign key for which the principal entity in the relationship is not known.
EF Core version: 5.0.0
The text was updated successfully, but these errors were encountered: