0

I'be been trying to map a Timespan property to a SqlCe 4.0 database using EntityFramework 4.1 Code-First approach, and of course I'm getting a NotSupportedException saying there's no store corresponding EDM type 'Time' and CLR type 'Timespan'.

I was already expecting this, but, according to this article, there's a conversion support since SqlCe 3.5 that maps a nvarchar(16) in the value form of 'hh:mm:ss.nnnnnnn' to a Time column.

Does anyone know if it's possible to use this with EF4.1 Code-First?

Regards

Guilherme Duarte
  • 3,371
  • 1
  • 28
  • 35

1 Answers1

1

The linked article refers to Merge Replication, not data type mapping in EF. You must either use a string and convert to and from timespan in code, or use datetime.

ErikEJ
  • 40,951
  • 5
  • 75
  • 115