I am using EF Core 5 and I have the following in my DBContext SaveChanges():
if (entityEntry.Metadata.Name == "ArticleBankAggregate.ArticleTag" && entityEntry.Metadata.DefiningNavigationName != "Tags")
{
entityEntry.Property("UpdatedDate").CurrentValue = DateTime.Now;
if (entityEntry.State == EntityState.Added)
{
entityEntry.Property("CreatedDate").CurrentValue = DateTime.Now;
}
}
To update a shadow property.
I am trying to upgrade to EF Core 6 and I get the following:
CS0618: 'IReadOnlyEntityType.DefiningNavigationName' is obsolete: 'Entity types with defining navigations have been replaced by shared-type entity types'
I cant find any examples or understand how to change this to use shared-type entities.