How to map bit datatype ?


in ms sql server 2008 r2 i have field defined as
  [enabled] [bit] NULL,
i used it as boolean field
I mapped it as
  TUser = class
    [Column('enabled', [])]
    Fenabled: Nullable<Boolean>;
     property enabled: Nullable<Boolean> read Fenabled write Fenabled;

but the value of enabled  does not return correct value and all the time it return false,  is it correct to map bit datatype to boolean if no how to map it?
ps : when i execute the sql script that is  generated by Aurelius in sql server  the value is 1 or 0

I think you need to map it as integer, then create non-mapped boolean property and implement getter and setter to read/write the integer value accordingly (convert from integer to boolean and vice-versa)

thanks, that is exactly what i thinking about

I mapped it to integer and create Non-mapped property Enabled as 

  property Enabled : Boolean read GetEnabled write SetEnabled;
 But it gives error 
"could not convert databse value to object member"
class name : TUser
column name : enabled
Attribute Name : Fenabled
Database Value : true
so i should deal with it as boolean, but object member value gives wrong value that is False although the database value is true

Any Comments?

You should map only the integer property. The boolean property should not be mapped, it's just for usage in the object itself.

yes, i got it