I have an Oracle 10g database in which the ASP.NET membership tables have been created by using the scripts available when installing Oracle ODP.NET. I want to handle these tables by using OpenAccess, so I have generated an entity diagram from the database and I have included these tables.
I have a problem when I try to invoke the context.GetAll
method for one of these tables. I get the following exception:
Message=The metadata for field 'APPLICATIONID1' of class 'OpenAccessTest.ORA_ASPNET_APPLICATION' cannot be initialized: Type converter initialization failed. The converter with name 'String2GuidConverter' does not convert from CLR type 'System.Guid' to SQL type 'RAW'.
Nombre del parámetro: converterName
It turns out that these tables have some fields of type RAW, that actually hold GUIDs. OpenAccess correctly assumes that the appropriate data type for the generated entity class should be System.Guid
, but as I have read in the documentation the RAW fields must be mapped to the type byte
. So I have changed the data type of all the RAW columns to byte
on the entity designer.
However now I have another problem. When I try to compile the project I get the following error:
Field: 'System.Byte EntityFrameworkTest.ORA_ASPNET_MEMBERSHIP::USERID1': The type of the single field identity field must be System.Byte, System.Int16, System.Int32, System.Int64, System.Guid, System.Char or System.String.
Parameter name: fieldType
So I can't compile the project because the column is not mapped to byte, but I can't map to byte because the colum is an identity field.
What can I do then?