Oracle 11g ODAC beta vresion EF4. , , . Stored Prodedure , , RefCusrose, In Views, (1,0) Boolean .
, Oracle , , , , .
1. .Config
ODAC EF Beta 2 Number (1, 0) Edm.Int16. app.config web.config (1, 0) Edm.Boolean.
- 2:
Oracle NUMBER (p, 0)
, app.config, web.config
machine.config.
, NUMBER (1, 0) Int16.
NUMBER (1, 0) .NET Bool .NET Byte.
.
app.config, ,
NUMBER (1, 0) Bool, NUMBER (3,0) ,
Int16, Int32, Int64 4, 9, 18
5, 10, 19 :
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<connectionStrings>
</connectionStrings>
<oracle.dataaccess.client>
<settings>
<add name="bool" value="edmmapping number(1,0)" />
<add name="byte" value="edmmapping number(3,0)" />
<add name="int16" value="edmmapping number(4,0)" />
<add name="int32" value="edmmapping number(9,0)" />
<add name="int64" value="edmmapping number(18,0)" />
</settings>
</oracle.dataaccess.client>
</configuration>
2. :
namespace convert{
static class boolConvert
{
public static bool boolchar(char ON)
{
switch (ON)
{
case 'O':
return true;
case 'N':
return false;
default:
return true;
}
}
public static char charbool(bool ON)
{
switch (ON)
{
case true:
return 'O';
case false:
return 'N';
default:
return 'O';
}
}
}
}
, : bool isSomthing = convert.boolConvert.boolchar('N'); char isSomthigEelse = convert.boolConvert.charbool(true);
3. POCO
, POCOs, . "MyField", - :
public bool MyField_Boolean
{
get
{
return MyField == 'O';
}
}
You cannot use MyField_Boolean inside an EF Linq query (because it is not a database property), but somewhere else in your code you can use it instead to get the logical version.
Although I have not tested any of them yet, but perhaps this will solve your problem. I hope that the next version of ODAC will not have these problems.