EF Core owned types incorrectly populated in database tree when using typed data set
Options
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:

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
-
This should be fixed in 6.0.19. Let me know how you get on.
-
Still there, (6.0.23) but with different icon though. -
@JoeAlbahari can you reproduce the issue? (see my last screenshot)
-
The entity no longer appears as queryable, though, right? If LINQPad were to hide it completely, there would be nowhere to go when you click the hyperlink on the owning type.
The other option would be to display the entity's members inline, although this would require some extra work.