NHibernate MySQL Enum

Posted by LnDCobra on Stack Overflow See other posts from Stack Overflow or by LnDCobra
Published on 2010-04-20T15:19:08Z Indexed on 2010/04/20 16:03 UTC
Read the original article Hit count: 196

Filed under:
|
|
|
|

I am trying to access the "MYSQL" database tables to create a GUI for adding users and privileges.

Doing this, I have run into my first NHibernate problem. How do i map MySQL Enum's to a C# Boolean? Or if not possible then to at least a Enum?

The database fields are delcared as

enum('N', 'Y')

These are all of the privilege fields in the database.

Now is there anyway of getting this into an enum or even better, boolean in C#/NHibernate?

Edit #1: In C# if I need to declare an enum it will be the following:

enum YesNoEnum
{
  Yes,
  No
}

© Stack Overflow or respective owner

Related posts about nhibernate

Related posts about c#