Page 1 of 1

NUMBER(1) automapped to BOOLEAN but true = -1, need true = 1

Posted: Tue 06 Jul 2010 09:18
by r.m.saddler
Hi,

We have many columns in our database of type NUMBER(1) and we store a 0 to represent FALSE and a 1 to represent TRUE.

The EF however is passing -1 to the database in the generated SQL - anyone where/how can I hook in to change this behaviour?

Many thanks,

Rob.

Posted: Wed 07 Jul 2010 14:46
by AndreyR
The following code uses "1" as a representation of the "true" boolean value.
Could you please post here the code you are using to insert?

Code: Select all

        Boolsptest bst = new Boolsptest
        {
          Id = 5,
          Boolfield = true
        };
        db.AddToBoolsptests(bst);
        db.SaveChanges();

I was using the latest 5.70.146 build for testing, Oracle 9.2.0.6.