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
|
We have an Entity with a DateTimeOffset? field, when we call BeginEdit we are getting an error that DBNull.Value cannot be converted to DateTimeOffset? I noticed in the source code that there is no code to handle DateTimeOffset or DateTimeOffset? in CreateValueGetter() (FieldModel.cs Line 527) and CreateValueSetter (FieldModel.cs Line 715); could this be the cause of the error? There are special cases for DateTime, DateTime?, TimeSpan, and TimeSpan? |
|
|
DateTimeOffset as a struct is handled as a value type (as is Nullable
|
|
|
I'll try to isolate it in a project, but adding the following code resolved the issue (The same thing was done to CreateValueSetter).
Is there a reason that DateTime? is handled here, but DateTimeOffset? is not? |
|
|
No I believe the only reason this wasn't added was because it wasn't needed, if I can confirm the problem via the repro I can look at adding this in to cover - Id like to understand the nature of the problem though first :)
|
|