In the database I have a ATIVO
field of type CHAR(1)
, where 'T' = true
and 'F' = false
.
Now, in my application I'm getting around this problem with a "gambiarra", where I mapped my Ativo
attribute to string
and created another bool IsAtivo
attribute that does something similar to this:
public bool IsAtivo
{
get { return Ativo == "T"; }
set { Ativo = value ? "T" : "F"; }
}
No need to comment that it's horrible that I already know, so I want to improve, when I implemented this I did not have time to look for ways to improve.
So I'd like to know if you know of any way to map this to nhibernate , by mapping the fluent-nhibernate ?
// Acredito que alguma configuração aqui pode resolver meu problema
Map(t => t.Ativo, "ATIVO")