Hello
We are using LLBLGen 2.5 Final (5. December 2007).
We use a custom TypeConverter to convert a field from an integer to a System.TimeSpan in the LLBLGen designer. Everything works fine - fetching, saving etc - as long as we don’t serialize an entity containing a TimeSpan field. The xml after a call to entity.WriteXml(…) also looks just fine:
<WorkItemWithProductInfoEntity Assembly="Test.DBLayer, Version=1.0.3373.25196, Culture=neutral, PublicKeyToken=null" Type="Test.DBLayer.EntityClasses.TestEntity">
<Fields>
<LengthInDays>
<CurrentValue Type="System.TimeSpan">4.00:00:00</CurrentValue>
<DbValue Type="System.TimeSpan">4.00:00:00</DbValue>
<IsChanged>False</IsChanged>
<IsNull>False</IsNull>
</LengthInDays>
.. more xml
But when we read the entity with a call to entity.ReadXml(…) we get “'entity.LengthInDays' threw an exception of type 'System.InvalidCastException'”. Any idea why this happens?
Olav