Mapping tinyint column to an enum - SOLVED
-
Hi I am trying to map an enum to a tinyint column, eg:
enum Foo : byte
{
Bar = 1,Baz = 2
}But I keep on getting a DBML1005: Not supported error. From digging through the code in Reflector I can see that an Enum can indeed map to a tinyint, and it should produce a warning about possible dataloss. Any suggestions? Am I missing something here? [update] arg, it seems you must NOT use the full type name... :doh: [update]
xacc.ide - now with IronScheme support
IronScheme - 1.0 alpha 1 out now -
Hi I am trying to map an enum to a tinyint column, eg:
enum Foo : byte
{
Bar = 1,Baz = 2
}But I keep on getting a DBML1005: Not supported error. From digging through the code in Reflector I can see that an Enum can indeed map to a tinyint, and it should produce a warning about possible dataloss. Any suggestions? Am I missing something here? [update] arg, it seems you must NOT use the full type name... :doh: [update]
xacc.ide - now with IronScheme support
IronScheme - 1.0 alpha 1 out nowHi, I ran into the same problem but the way to fix it for me was to prefix the enum type name with global:: I ended up with the following dbml fragment:
<Column Name="Foo" Type="**global::**MyNamespace.Foo" DbType="TinyInt NOT NULL" IsPrimaryKey="true" CanBeNull="false" />