File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -252,6 +252,18 @@ private void AddDefaultTypeSerializers() {
252252 serialize : ( DateTime clr ) => clr . Ticks ,
253253 deserialize : ( SqliteValue sqlite , Type clrType ) => new DateTime ( sqlite . CastInteger )
254254 ) ;
255+ #if NET6_0_OR_GREATER
256+ RegisterType < DateOnly > (
257+ SqliteType . Integer ,
258+ serialize : ( DateOnly clr ) => clr . ToDateTime ( TimeOnly . MinValue ) . Ticks ,
259+ deserialize : ( SqliteValue sqlite , Type clrType ) => DateOnly . FromDateTime ( new DateTime ( sqlite . CastInteger ) )
260+ ) ;
261+ RegisterType < TimeOnly > (
262+ SqliteType . Integer ,
263+ serialize : ( TimeOnly clr ) => clr . Ticks ,
264+ deserialize : ( SqliteValue sqlite , Type clrType ) => new TimeOnly ( sqlite . CastInteger )
265+ ) ;
266+ #endif
255267 RegisterType < Uri > (
256268 SqliteType . Text ,
257269 serialize : ( Uri clr ) => clr . AbsoluteUri ,
You can’t perform that action at this time.
0 commit comments