Or better:

public class Something
{
  protected virtual int myIntValue { get; set; }
  public MyEnumeration MyEnumeratedValue
  {
    get
    {
      return((MyEnumeration) this.myIntValue);
    }
    set
    {
      this.myIntValue = value;
    }
  }
}


On Aug 3, 8:14 am, "Frans Bouma" <[email protected]> wrote:
> Implement IUserType for this conversion between 'Enum' (model side) and Char
> (db side) and vice versa, then assign the IUserType implementation to the
> field in question by specifying it in the mapping.
>
>         FB
>
>
>
> > I've a status field on my table users and i wish to make this field with
> > defined data 'A' = active, 'B' = block, 'I' = inative.
> > Before I use NHibernate I used an enum in C# and I converted it to char
> > before save and to enum after select.
>
> > Someone have a tip for do it?
> > of course hard codes are not so good.
>
> > Thank you for your help.
>
> > Rúben Lício Reis
> > +55 11 67041245
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "nhusers" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected].
> > For more options, visit this group at
> >http://groups.google.com/group/nhusers?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to