DateTime Ticks support for EF Code First?
Posted: Tue 17 Apr 2012 23:28
I'm using dotConnect for SQLite 3.80.341, professional edition
Entity Framework 4.3.1, Code First
Everything works great when my connection uses the ISO-8601 encoding for datetime. When I change my connection to use Ticks, however, I get a FormatException when the entity is being deserialized from the database:
[code]System.FormatException : Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, ref NumberBuffer number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt64(String value, NumberStyles options, NumberFormatInfo numfmt)
at Devart.Data.SQLite.a5.b(String A_0)
at Devart.Data.SQLite.Entity.l.a(Int32 A_0)
at System.Data.Common.Internal.Materialization.Shaper.ErrorHandlingValueReader`1.GetValue(DbDataReader reader, Int32 ordinal)
at lambda_method(Closure, Shaper)
at System.Data.Common.Internal.Materialization.Coordinator`1.ReadNextElement(Shaper shaper)
at System.Data.Common.Internal.Materialization.Shaper`1.SimpleEnumerator.MoveNext()
at System.Linq.Enumerable.First(IEnumerable`1 source)
at System.Linq.Queryable.First(IQueryable`1 source)
at DataWriteTests.PerformanceTest.TestSelectRange() in PerformanceTest.cs: line 175[/code]
My query is extremely simple:
pdx.DoubleData.First();
Where my DbContext is "pdx" and entity set is DoubleData
Is there some hidden API I'm not using correctly? Or are ticks just not supported?
Thanks!
Entity Framework 4.3.1, Code First
Everything works great when my connection uses the ISO-8601 encoding for datetime. When I change my connection to use Ticks, however, I get a FormatException when the entity is being deserialized from the database:
[code]System.FormatException : Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, ref NumberBuffer number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt64(String value, NumberStyles options, NumberFormatInfo numfmt)
at Devart.Data.SQLite.a5.b(String A_0)
at Devart.Data.SQLite.Entity.l.a(Int32 A_0)
at System.Data.Common.Internal.Materialization.Shaper.ErrorHandlingValueReader`1.GetValue(DbDataReader reader, Int32 ordinal)
at lambda_method(Closure, Shaper)
at System.Data.Common.Internal.Materialization.Coordinator`1.ReadNextElement(Shaper shaper)
at System.Data.Common.Internal.Materialization.Shaper`1.SimpleEnumerator.MoveNext()
at System.Linq.Enumerable.First(IEnumerable`1 source)
at System.Linq.Queryable.First(IQueryable`1 source)
at DataWriteTests.PerformanceTest.TestSelectRange() in PerformanceTest.cs: line 175[/code]
My query is extremely simple:
pdx.DoubleData.First();
Where my DbContext is "pdx" and entity set is DoubleData
Is there some hidden API I'm not using correctly? Or are ticks just not supported?
Thanks!