datastax/csharp-driver — pull request #31 by teddymaef (2014-05-22 09:09:43+00:00)
Title: Feature/timestamp default type bug

This is a bug introduced in latest 2.0 beta version, because it works fine in 1.0.

When CqlDataAdapter.Fill() works with columns of timestamp type, since it always calls CqlReader.GetValues() which calls TypeInterpreter.ConvertFromTimestamp() internally and the cSharpType parameter passing to TypeInterpreter.ConvertFromTimestamp() is always typeof(object). When it is typeof(object), before the fix, it will return DateTime value, which will cause exception.

The expectation is, since when cSharpType == null, ConvertFromTimestamp() returns DateTimeOffset value, it should be same as when cSharpType == typeof(object) to also return DateTimeOffset value.

If you don't think this is a good solution, maybe you could fix in another way, as long as you could make sure, the default type for timestamp type value should be DateTimeOffset, not DateTime.