daelmo wrote:
What is the stack trace?
What LLBLGen version and runtime libraries are you using?
When I was debugging it I found following:
/// <summary> The DateEventStart property of the Entity Event<br/><br/></summary>
/// <remarks>Mapped on table field: "Events"."DateEventStart"<br/>
/// Table field type characteristics (type, precision, scale, length): DateTimeOffset, 0, 0, 0<br/>
/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
public virtual System.DateTimeOffset DateEventStart
{
get { return (System.DateTimeOffset)GetValue((int)EventFieldIndex.DateEventStart, true); }
set { SetValue((int)EventFieldIndex.DateEventStart, value); }
}
basically call to
GetValue((int)EventFieldIndex.DateEventStart, true);
returns null which is then casted to DateTimeOffset.
When I checked another property but of type DateTime there GetValue call actually returned DateTime.MinValue which then was casted to DateTime. My assumption is that GetValue method (when the second parameter is "true") should return a default value for given type: 0 for int, DateTime.MinValue for the DateTime and similarly a MinValue for the DateTimeOffset struct, but it returns null thus the error, this is identical to
// LinqPad used here
object v = null;
((DateTimeOffset)v).Dump();
which throws the same exception
Runtime is 4.2
Thank you!