entity-framework – How to map an enumerator using EntityTypeConfiguration from Entity Framework 6?

Question:

good night, i have my next class

public class Endereco {
    public string Bairro { get; set; }
    public string Cidade { get; set; }
    public EUF Estado { get; set; }
}

and my enumerator

public enum EUF {
    SP = 1,
    PR = 2,
    SC = 3
}

and my mapping class

public EnderecoConfig : EntityTypeConfiguration<Endereco> {
    public EnderecoConfig() {
        Property(x => x.Cidade);
    }
}

How do I map this Enum using EntityTypeConfiguration?

I'm used to FLUENT NHIBERNATE where we use CustomType<EUF>()

Answer:

Well, after a few searches and everything, I have the following answer:

Nothing, no configuration needed.

Just use Property(x => x.Estado);

Scroll to Top