This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I've got a MySQL db with a table created using the following script : CREATE TABLE IF NOT EXISTS `Sessions` (
In my data access layer I have a function that looks like this : void func(SessionDto session) { (...) Session x = uow.Sessions.Where(s => s.SessionGuid == session.SessionGuid).Single(); (...) }
The highlighted line results in an exception with the following message : + $exception {"Unable to materialize field [SessionActive] on type [ModularEnergy.Server.DAL.Session]. Check your table has an Id column and that your mappings are correct. See inner exception for details. "} System.Exception {Mindscape.LightSpeed.LightSpeedException} + InnerException {"Object of type 'System.Boolean' cannot be converted to type 'System.SByte'."} System.Exception {System.ArgumentException}
What's wrong I thought boolean-sbyte thing was covered ? |
|
|
The SessionActive property in your model is defined as SByte. You need to change it to Boolean to be consistent with the SessionActive database column. We did have a bug where TINYINT(1) columns in MySQL would be inferred by the designer as SByte instead of Boolean (though I'm surprised to see this issue occurring with columns *declared* as BOOLEAN, even though BOOLEAN is a synonym for TINYINT(1)). This has since been fixed as far as we know (see http://www.mindscape.co.nz/forums/Thread.aspx?PostID=9512 for more info). If you can reproduce the designer inference issue with current nightlies then please let us know and we'll investigate further. |
|
|
That worked, cheers! |
|