markrendle / Simple.Data

A light-weight, dynamic data access component for C# 4.0
MIT License
1.33k stars 303 forks source link

Bulk insert entries with DateTimeOffset values not working #297

Closed denbkh closed 10 years ago

denbkh commented 11 years ago

TestCase:

var db = Database.Open();
dynamic entry = new ExpandoObject();
entry.DateValue = DateTimeOffset.Now;
db.Table.Insert(new[] { entry, entry, entry });

Result:

System.ArgumentException : Unable to cast object of type 'System.DateTimeOffset' to type 'System.IConvertible'.Couldn't store <07.06.2013 21:45:24 +04:00> in DateValue Column. Expected type is DateTime. ----> System.InvalidCastException : Unable to cast object of type 'System.DateTimeOffset' to type 'System.IConvertible'.