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 am getting the following exception on a new field I added. Another field which is declared in exactly the same way (only difference is the name) does not have this problem. {"Unable to materialize field [ServerMaxCapacity] on type [DAL.Subscription]. Check your table has an Id column and that your mappings are correct. See inner exception for details. "} {"Object of type 'System.DBNull' cannot be converted to type 'System.Nullable`1[System.UInt32]'."} DAL: private Nullable<uint> _serverMaxCapacity; MySQL: ColumName=ServerMaxCapacity; DataType=Int(5); NotNull=false; AutoInc=false; Unsigned=true; Zerofill=false; |
|
|
Could you try changing the uint to an int and see if that fixes the problem? If this does work, but you want to keep it as an unsigned int for domain model reasons, let us know. |
|
|
Thanks, that does indeed fix the problem. In order to hide this work-around from the higher layers, I did added type-casting in the DAL: private Nullable<int> _serverMaxCapacity; |
|
|
By the way, we've put a fix into recent nightly builds that addresses this problem at source -- I'm not suggesting unpicking your existing workaround, but for future models you will be able to use nullable uints as field types without needing the workaround. |
|