@@ -9,6 +9,8 @@ internal static class ExtractColumns
9
9
{
10
10
return typeName switch
11
11
{
12
+ "bool" => ExtractBool ( source : source ) ,
13
+ "bool?" => ExtractNullableBool ( source : source ) ,
12
14
"byte" => ExtractUInt8 ( source : source ) ,
13
15
"byte?" => ExtractNullableUInt8 ( source : source ) ,
14
16
"sbyte" => ExtractInt8 ( source : source ) ,
@@ -43,6 +45,7 @@ internal static class ExtractColumns
43
45
{
44
46
return typeName switch
45
47
{
48
+ "bool" => ReturnBool ( variable : variable ) ,
46
49
"byte" => ReturnUInt8 ( variable : variable ) ,
47
50
"sbyte" => ReturnInt8 ( variable : variable ) ,
48
51
"short" => ReturnInt16 ( variable : variable ) ,
@@ -88,6 +91,11 @@ private static string ReturnInt8(string variable)
88
91
return $ "return Convert.ToSByte({ variable } );";
89
92
}
90
93
94
+ private static string ReturnBool ( string variable )
95
+ {
96
+ return $ "return Convert.ToBoolean({ variable } );";
97
+ }
98
+
91
99
private static string ReturnUInt8 ( string variable )
92
100
{
93
101
return $ "return Convert.ToByte({ variable } );";
@@ -148,6 +156,16 @@ private static string ReturnFloat(string variable)
148
156
return $ "return Convert.Double({ variable } );";
149
157
}
150
158
159
+ private static string ExtractBool ( CodeBuilder source )
160
+ {
161
+ return ExtractCommon ( source : source , typeName : "bool" , nameof ( ExtractBool ) , isNullable : false , getReturnStatement : ReturnBool ) ;
162
+ }
163
+
164
+ private static string ExtractNullableBool ( CodeBuilder source )
165
+ {
166
+ return ExtractCommon ( source : source , typeName : "bool" , nameof ( ExtractNullableBool ) , isNullable : true , getReturnStatement : ReturnBool ) ;
167
+ }
168
+
151
169
private static string ExtractInt8 ( CodeBuilder source )
152
170
{
153
171
return ExtractCommon ( source : source , typeName : "sbyte" , nameof ( ExtractInt8 ) , isNullable : false , getReturnStatement : ReturnInt8 ) ;
0 commit comments