Boolean properties mapping

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
Alladin
Posts: 149
Joined: Mon 27 Nov 2006 16:18
Contact:

Boolean properties mapping

Post by Alladin » Wed 07 Apr 2010 18:02

Hi there,

I'd like to save my boolean fields as CHAR(1) datatype using following idea:
'Y' is for true, 'N' for false or as NUMBER(1) datatype with 1 or 0.

However LINQ to Oracle SQL is always trying to insert full-text sting 'False' and 'True'.

How to achieve my mapping logic?

Thank you in advance,
Lex

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 08 Apr 2010 14:38

I recommend you to create a wrapper boolean property for this column, like I advised in this post:
http://www.devart.com/forums/viewtopic.php?p=54625

Alladin
Posts: 149
Joined: Mon 27 Nov 2006 16:18
Contact:

Post by Alladin » Sat 10 Apr 2010 01:17

Wrapping is not good, because you'll not be able to use this property in selects...

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Mon 12 Apr 2010 16:52

I have replied to you here:
http://www.devart.com/forums/viewtopic.php?p=55470
NUMBER(1) mapping to bool should do the trick.

Post Reply