Enum datatypes
Posted: Thu 27 Jun 2013 16:55
Hello,
in my model I have something like Status defined as AppointmentStatus datatype and mapped to a SQLite appointment.status field defines as smallint.
When I assign status = AppointmentStatus.Scheduled and then post to the database I get:
A first chance exception of type 'System.InvalidCastException' occurred in mscorlib.dll
Invalid cast from 'System.Int16' to 'BonfiSoft.VCL.Data.AppointmentStatus'.
if I change the type in the entity model to int and assign status = (int)AppointmentStatus.Scheduled it works
Any help would be appreciated
V/r
Alberto
in my model I have something like Status defined as AppointmentStatus datatype and mapped to a SQLite appointment.status field defines as smallint.
When I assign status = AppointmentStatus.Scheduled and then post to the database I get:
A first chance exception of type 'System.InvalidCastException' occurred in mscorlib.dll
Invalid cast from 'System.Int16' to 'BonfiSoft.VCL.Data.AppointmentStatus'.
if I change the type in the entity model to int and assign status = (int)AppointmentStatus.Scheduled it works
Any help would be appreciated
V/r
Alberto