Boolean values
Posted: Tue 16 Mar 2010 13:52
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?
Discussion forums for open issues and questions concerning database tools, data access components and developer tools from Devart
https://forums.devart.com/
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;
}
}
from t in ctx.Customers where t.BoolWrapper select t;