Boolean values
Boolean values
How can I map a CHAR(1) column containing 'Y' or 'N' to a boolean on the Entity Framework using Devart Oracle dotConnect and Entity Framework?
You can try adding similar code to the partial entity definition in the DataSourceModel.cs file in case you are using Devart Entity model:
This wrapper works for inserts and updates.
Code: Select all
public bool? BoolWrapper {
get {
if (Boolfield == null)
return null;
if (Boolfield == "Y" || Boolfield == "y")
return true;
if (Boolfield == "N" || Boolfield == "n")
return false;
return null;
}
set {
if (value != null)
if (value == true)
Boolfield = "Y";
else
Boolfield = "N";
else
Boolfield = null;
}
}