Quantcast
Channel: EntityFramework Reverse POCO Code First Generator
Viewing all articles
Browse latest Browse all 1642

Created Unassigned: bit with string as default value always returns true [177]

$
0
0
It is possible to use both the integer values _0_ or _1_ __AND__ the string values _true_ or _false_ as default values for the bit data type in SQL Server.

The T4 template does not handle the string values:

```
Default = (Default == "0") ? "false" : "true";
```
_(EF.Reverse.POCO.Core.ttinclude - line number 823)_

As described, this will return _true_, because the string value is not handled. I would suggest changing to something like this

```
Default = (Default == "0" || Default == "false") ? "false" : "true";
```

/Thomas


Viewing all articles
Browse latest Browse all 1642

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>