I am currently evaluating dotConnect for PostgreSQL. I am using Entity Framework 4.3.1 with DbContext (Database first), and I was wondering if there was support for mapping a smallint column in PostgreSQL to a System.Byte field on an entity?
When I map a smallint field to an Int16 I have no issues. When I update my model in the designer (or update the CSDL directly) to map the same column to a Byte field I get the following error when attempting to load from the database:
Code: Select all
Unhandled Exception: System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.Byte.Parse(String s, NumberStyles style, NumberFormatInfo info)
at Devart.Data.PostgreSql.h.af(Byte[] A_0, Int32 A_1, Int32 A_2)
at Devart.Common.r.ap(Byte[] A_0, Int32 A_1, Int32 A_2)
at Devart.Data.PostgreSql.aj.ap(Byte[] A_0, Int32 A_1, Int32 A_2)
at Devart.Data.PostgreSql.PgSqlDataReader.GetByte(Int32 i)
at Devart.Data.PostgreSql.Entity.i.a(Int32 A_0)
at Devart.Common.Entity.bc.GetValue(Int32 ordinal)
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.Shaper.HandleEntityAppendOnly[TEntity](Func`2 constructEntityDelegate, EntityKey entityKey, EntitySet entitySet)
at lambda_method(Closure , Shaper )
at System.Data.Common.Internal.Materialization.Coordinator`1.ReadNextElement(Shaper shaper)
at System.Data.Common.Internal.Materialization.Shaper`1.RowNestedResultEnumerator.MoveNext()
at System.Data.Common.Internal.Materialization.Shaper`1.ObjectQueryNestedEnumerator.TryReadToNextElement()
at System.Data.Common.Internal.Materialization.Shaper`1.ObjectQueryNestedEnumerator.ReadElement()
at System.Data.Common.Internal.Materialization.Shaper`1.ObjectQueryNestedEnumerator.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
Code: Select all
Code: Select all
Is there something simple I'm missing?
Thanks!
-Mark