Home

EF Core owned types incorrectly populated in database tree when using typed data set

Linqpad 6 incorrectly lists EF Cores Owned-Types as "DbSets" in the Tree when using typed data set.

Owned entity docs: (https://docs.microsoft.com/en-us/ef/core/modeling/owned-entities)

For example take this model:


public class EntityMetadata
{
public Instant Created { get; set; }
public Instant? Modified { get; set; }
public Instant? Deleted { get; set; }
}

public abstract class Entity : IEntity
{
public int Id { get; private set; }
public EntityMetadata Metadata { get; private set; } = new EntityMetadata(); // Mapped as Owned type!
public bool IsDeleted { get; private set; }
}

public class Person : Entity {}
public class Company : Entity {}
public class Order: Entity {}
public class Offer: Entity {}
... // some other entities
...


Linqpad lists multiple "EntityMetadata" nodes in the tree:


Comments

Sign In or Register to comment.