npgsql 6.0 时间格式报错 返回

SqlSugar
2 358

Cannot write DateTime with Kind=Unspecified to PostgreSQL type 'timestamp with time zone', only UTC is supported. Note that it's not possible to mix DateTimes with different Kinds in an array/range. See the Npgsql.EnableLegacyTimestampBehavior AppContext switch to enable legacy behavior

热忱回答2

  • fate sta fate sta VIP0
    2021/11/15

    https://github.com/npgsql/doc/blob/main/conceptual/Npgsql/types/datetime.md/

    0 回复
  • fate sta fate sta VIP0
    2021/11/15
    AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
    AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true);

      看着像要配置一下 ,6.0 有些变化

    0 回复