Skip to content

An enum property isn't mapped to the PostgreSQL enum inside value objects #623

@YohDeadfall

Description

@YohDeadfall

The problem occurs only for value objects inside complex objects. The following example maps PhoneNumberType to int:

public enum PhoneNumberType
{
    Mobile,
    Home,
    Work
}

public class PhoneNumber
{
    public PhoneNumberType Type { get; set; }
    public int Number { get; set; }
}

public class Contact
{
    public PhoneNumber Phone { get; set; }
}
builder.OwnsOne(e => e.Phone).Property(p => p.Type);
builder.OwnsOne(e => e.Phone).Property(p => p.Number);

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions