Base solution for your next web application

Activities of "kompila"

Hi oguzhanagir, thank you for the answer and for putting me on the right way.

I preferred to extending EntityHistoryStore using a more generic method, because the entity HomeAddress is owned by different entities and I had the same problem with other owned entities. So this is my method:

public override Task SaveAsync(EntityChangeSet changeSet)
{
    foreach (var change in changeSet.EntityChanges)
    {
        EntityEntry entityEntry = (EntityEntry)change.EntityEntry;
        if (entityEntry.Metadata.IsOwned())
        {
            var ownership = entityEntry.Metadata.FindOwnership();
            if (ownership != null)
            {
                change.EntityTypeFullName = ownership.PrincipalEntityType.Name;
            }
        }
    }

    return base.SaveAsync(changeSet);
}

It seems to work as I need. Thank you

Showing 1 to 1 of 1 entries